Jump to content
  • Advertisement

Archived

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

eng3d

common questions :take a screenshot?

This topic is 6006 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 i can made a screenshot using code? ----------------------------------------------- "Cuando se es peon, la unica salida es la revolución"

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
This website is where I learned how to take screenshots and save them to bitmap:

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

Share this post


Link to post
Share on other sites
tnk.

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

"Cuando se es peon, la unica salida es la revolución"

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:
LPDIRECT3DSURFACE8 pTempBB;
D3DDevice->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pTempBB );
D3DXSaveSurfaceToFile( [I forgot the exact params, but they are filename, surface pointer, and file type] );
pTempBB->Release();
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

  • 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!