Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working with CBitmaps (24 bpp).
If the loaded bitmap is not 24 bpp, so my app will crach.
I've searched how to convert 1 bpp, 4 bpp, 8 bpp & 16 bpp to 24 bpp, but unfortunatly no chance.

Help me please
Posted
Updated 26-Jun-11 10:03am
v2

How do you load the bitmaps? Anyway, have a look at CImage[^] class.
 
Share this answer
 
Comments
Mr. Tomay 27-Jun-11 13:53pm    
HANDLE WINAPI LoadImage(
__in_opt HINSTANCE hinst,
__in LPCTSTR lpszName,
__in UINT uType,
__in int cxDesired,
__in int cyDesired,
__in UINT fuLoad
);
CPallini 27-Jun-11 15:18pm    
Have you tried the CImage class? It should be easier.
Mr. Tomay 28-Jun-11 16:08pm    
I don't see any transformation functions in CImage class members. see: http://msdn.microsoft.com/en-US/library/5eb252d0.aspx
Are you sure LoadImage() is crashing? Have you checked the return type? Make sure that it's not returning NULL, if its not, then something else may be the problem.
 
Share this answer
 
v2
Comments
Mr. Tomay 22-Jul-11 14:40pm    
No, LoadImage() is not crashing. My program is crashing when the loaded image is not 24 bpp. So I have to convert it to 24 bpp bitmap.
Albert Holguin 22-Jul-11 15:29pm    
Well what's the error then when the application crashes? Look at the call stack and figure out which call is causing it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900