Bitmap dimenions
I used the LoadImage() function to load a certian .bmp file.
I couldn't find a way to retrieve bitmap's width/ height in pixels.
Can anyone help ?
I'm in good mood, I'll throw a snippet here [smile]
Oxyd
HBITMAP bitmap = (HBITMAP)LoadImage (hInstance, "myCoolBitmap.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);BITMAP bmpInfo;GetObject (bitmap, sizeof (BITMAP), (void *)&bmpInfo);int width = bmpInfo.bmWidth;int height = bmpInfo.bmHeight;//there are many other members in bmpInfo - check the documentation =)doAllTheCoolThingsWithTheBitmap (bitmap, width, height);//don't forget the clean-up!DeleteObject (bitmap);
Oxyd
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement