Advertisement Jump to content
Sign in to follow this  
Luonnos

Opening Bitmaps in MFC

This topic is 3678 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'm making a game in C++, and I need to open a bitmap in MFC (I'm using VC++ 2008). I have to perform a few color transformations on the image before I can display it, so I need to store the image in an array. I'm sure there's a simple command to do this, but I've been searching and can't seem to find one. Could anyone help?

Share this post


Link to post
Share on other sites
Advertisement
There's a class called CImage. It makes it very easy to open images and have them as arrays.

The code is as follows:


CString Cfilename( filename.c_str() ); // Convert from filename to CString
CImage openedCImage;
if( openedCImage.Load( Cfilename ) != S_OK ){ throw( std::string("Error") ); }



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!