Jump to content
  • Advertisement
Sign in to follow this  
davidcoleman

Save memory DC to file

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

Advertisement
Quote:
Original post by davidcoleman
hmmm... microsoft could have make it less complicated

Thanks for the link! The code works but leaks somewhere in SaveBMPFile function.
Hmm, so it does. You'll need to delete[] lpbi and lpvBits before exiting the function (Which is in all those return 0; cases), or use a std::vector<char> and have them automatically destroyed when they go out of scope (Which is what I'd recommend if you're using C++).

Share this post


Link to post
Share on other sites
There are less complicated ways to do it. Ex: use GDI+'s Bitmap::FromHBITMAP to create a Bitmap object and then use the Save() member function to save it to a file.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!