Jump to content
  • Advertisement
Sign in to follow this  
TomTomson

strecht surface?

This topic is 4875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi i have a problem with getting a screenshot of a specific part of the screen. i use IDirect3DSurface9* backbuffer; pD3DDevice->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO,&backbuffer); D3DXSaveSurfaceToFile("test.bmp", D3DXIFF_BMP, backbuffer, NULL, NULL); to take a screenshot, but i just want to save a part of the backbuffer. i have tried StretchRect(IDirect3DSurface9 *pSourceSurface, CONST RECT *pSourceRect, IDirect3DSurface9 *pDestSurface, CONST RECT *pDestRect, D3DTEXTUREFILTERTYPE Filter ) but it dosn't work... thanks for your help thomas

Share this post


Link to post
Share on other sites
Advertisement
There is an article posted here on GameDev about how to take a screenshot using D3D. It was written for DirectX 8 but the same code still applies for DX9.

neneboricua

Share this post


Link to post
Share on other sites
thanks, i know that acticle but it does not realy solve my problem, because it doesn't work anymore in directx 9 in that way
in directx you just have to call
device->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO,&pDestSurface);
and that's it you have your screenshot.
for the function
device->CreateImageSurface(screenx, screeny, D3DFMT_A8R8G8B8, &pDestSurface);
is a similar in directx 9
device->CreateOffscreenPlainSurface(width,height,D3DFMT_X8R8G8B8,D3DPOOL_DEFAULT,&&pDestSurface,NULL);
but if i call it before GetBackBuffer my programm crashs...

thomas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!