Crazy DWORD aligned dibs
I've a mental block on calculating dword aligned widths for DIB's - just noticed this nugget in the MSDN docs
biSizeImage :
I love it when the docs reflect my reality
Calculating the size of a bitmap is not difficult:The crazy roundoffs and shifts account for the bitmap being DWORD-aligned at the end of every scanline.
biSizeImage = ((((biWidth * biBitCount) + 31) &
~31) >> 3) * biHeight:

0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home