common questions :take a screenshot?

Started by
3 comments, last by eng3d 22 years, 3 months ago
how i can made a screenshot using code? ----------------------------------------------- "Cuando se es peon, la unica salida es la revolución"
-----------------------------------------------"Cuando se es peon, la unica salida es la revolución"
Advertisement
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.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
This website is where I learned how to take screenshots and save them to bitmap:

http://www.geocities.com/foetsch/screenshot/screenshot.htm
tnk.

-----------------------------------------------

"Cuando se es peon, la unica salida es la revolución"
-----------------------------------------------"Cuando se es peon, la unica salida es la revolución"
What a horribly messy way to do it. Try this much simpler call: D3DXSaveSurfaceToFile. Here''s what you might do:
LPDIRECT3DSURFACE8 pTempBB;
D3DDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pTempBB );
D3DXSaveSurfaceToFile( );<br>pTempBB->Release();<br>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. <br><br>—————————–<br>The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

This topic is closed to new replies.

Advertisement