Jump to content
  • Advertisement
Sign in to follow this  
dragon9

Screenshots in DirectX 9

This topic is 4982 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

How do I save the contents of the frame buffer to a file (BMP, JPG, etc.)? There is a great little sample on how to do this in DX 8 but some of the interfaces were discontinued in DX 9. Thanks...

Share this post


Link to post
Share on other sites
Advertisement
It's really easy [smile]. Just get the current rendertarget (the backbuffer), and write the surface to file, using D3DX.


LPDIRECT3DSURFACE9 pSurf;
pd3dDevice->GetRenderTarget( 0, &pSurf );

D3DXSaveSurfaceToFile( L"screenshot.bmp", D3DXIFF_BMP, pSurf, NULL, NULL );
pSurf->Release();

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!