Jump to content
  • Advertisement
Sign in to follow this  
EODCyismARDEM

framebuffer to bitmap file

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

I am using Lock on a DirectDraw front buffer to draw pixels to the screen. I need to capture a screenshot and write it to a file. I have tried to configure directx to capture the screen when prntscrn is pressed but it doesn't work (maybe because I'm writing directly to the front buffer??) So i have a pointer to an array of size 640x480, with 24 bit pixels. All I need to do is write this to a bitmap. When I try to google an answer I get stuff that deals with DC GDI stuff, and say"all you need is a DC context or something" Well i'm not familiar at all with gdi stuff and I have trouble if I try to implement this stuff. Can somebody please help me out with this.

Share this post


Link to post
Share on other sites
Advertisement
Slightly OT, but why the hell are you writing directly to the front buffer? Surely it'd be better to write to the back buffer then flip?

Share this post


Link to post
Share on other sites
Thanks alot Smack0007, GetDC was exactly what I needed.

For people that possibly search this post in the future, This page: http://www.geocities.com/foetsch/screenshot/screenshot.htm solved my problem. It has a code listing on the bottom that takes a screenshot from a directdraw buffer.

Nurgle: I write to a backbuffer but then bitblt to the front, rather than flip. Thats what I meant by writing to the frontbuffer, I guess I was a little misleading.

Share this post


Link to post
Share on other sites
Hmmm... I think you really want to flip instead of blit... (I'm a poet and I wasn't aware of the fact)



Technically, blitting is just changing the starting address of the video buffer, where as blitting involves copying the memory, ergo, flip=faster. I'm not sure if modern cards still do this, but that's how it used to be in the good ol' days of Mode 13H.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!