Can’t understnand what is wrong with this code:
HBITMAP bm = 0;
BITMAP Bitmap;
bm = (HBITMAP)LoadImage (0, path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
int error = GetObject( &Bitmap, sizeof( BITMAP ), &bm );
The LoadImage function returns non null pointer.
However GetObject returns 0, which indicates on error.
I want to get size info and image data from HBITMAP pointer (the pointer can be passed as parameter, so I can’t change the way I load the bitmap file).
Maybe putting the parameters in the right places will help:
See the documentation on
GetObject()for more info.