This topic is now archived and is closed to further replies.


common questions :take a screenshot?

Recommended Posts

Assuming it is a screenshot of _your_ program : Lock()ing the drawing surface will yield you a pointer to the video buffer. Use the data in the buffer to build a file in a recognizable gfx format and save it.

If its not your program, I don''t know.

Share this post

Link to post
Share on other sites
What a horribly messy way to do it. Try this much simpler call: D3DXSaveSurfaceToFile. Here''s what you might do:
D3DDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pTempBB );
D3DXSaveSurfaceToFile( [I forgot the exact params, but they are filename, surface pointer, and file type] );
With a bit of clever coding you can detect whether a file exists or not, and use scrnshotX.bmp and increment X each time. When i get home ill post the full code.

The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.

Share this post

Link to post
Share on other sites