Link to home
Start Free TrialLog in
Avatar of jxbma
jxbmaFlag for United States of America

asked on

How do I programatically determine the byte length of a windows BITMAP?

Hi:

I'm building a windows utility application that works with bitmaps.

If I have an HBITMAP or LPBITMAP, how do I determine the byte count of the actual image?

Is it inferred from bmBitsPixel * bmWidth * bmHeight?

Thanks,
JohnB
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Um, it's actually a bit simpler than 'rounding up':

DWORD dwBmpSize = ((bm.bmBitsPixe / 8) + 1) * bm.bmWidth * bm.bmHeight;

Open in new window

Avatar of jxbma

ASKER

Once again. Cool. Thx