Sign in to follow this  

SDL_LoadBMP Problems... Colors Garbled

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

This topic is 3859 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this