Screenshots in DirectX 9
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...
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();
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement