Jump to content
  • Advertisement
Sign in to follow this  
squimmy

SDL_LoadBMP Problems... Colors Garbled

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

Hi, I've been spending a while trying to write a program to take a screenshot of the desktop, save it as a BMP and then load that BMP as an SDL Surface. Well, I've done the first part but when I go to load it it... appears wrong. All my image programs load it fine, paint, Windows Photo Gallery it all loads fine. But when my program loads it as an SDL Surface the colours are completely wrong. Heres what appears: http://xs215.xs.to/xs215/07211/badsdl.jpg Obiously....that's not what I see. I'm running the normal vista theme. To load it my code it quite simply:
    loadedImage = SDL_LoadBMP( filename.c_str() );
Dying for help... so... please help! Thanks. [Edited by - squimmy on May 21, 2007 3:57:41 PM]

Share this post


Link to post
Share on other sites
Advertisement
Nah, I know the loading code is fine. If I make a bmp with paint or somethings it's fine. It's the screenshot code, which is the same as:

http://www.codeguru.com/Cpp/G-M/bitmap/capturing/article.php/c4915



In fact, if I use that proggie, same problem occurs when I go to load the saved BMP.

Share this post


Link to post
Share on other sites
Are you sure you're loading a BMP file? The link you provided is for a JPG.

Share this post


Link to post
Share on other sites
Yes, very.

To show you the result I just had to take a screenshot with prntscrn and paste it to paint, which saved it as a jpg.

Share this post


Link to post
Share on other sites
Anybody?

If nobody knows this, then it would also be helpful if somebody could tell my why I am getting the following error when compiling jpeglib.h, even though in the WindowBitmap project that file compiles fine:

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\JPEGLIB.H(910): error C2061: syntax error : identifier 'FILE'


Thanks.

Share this post


Link to post
Share on other sites
IIRC the BMP format doesn't support Alpha-channel images. If your Vista install is using alpha-blending then it's likely that there's some new BMP format in use that supports RGBA mapping or something that isn't included in the SDL BMP loader.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!