Bitmap dimenions

Started by
0 comments, last by Oxyd 19 years, 6 months ago
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 ?
There is nothing that can't be solved. Just people that can't solve it. :)
Advertisement
I'm in good mood, I'll throw a snippet here [smile]

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