BITMAPINFOHEADER biHeight is twice as much as I expect

I am writing a C application for parsing Windows icon files (ICO).

When I read an existing icon entry in the BITMAPINFOHEADER structure, all the variables in the structure contain the expected values, except that biHeight , which should contain the height in pixels of the image, is always twice what it should be.

So for example, if I have a 64x64 icon, biWidth is 64, but biHeight is 128.

Is this the expected behavior? This is my first time when it comes to BITMAPINFOHEADER .

I mainly work from an article

+6
source share
1 answer

Yes, it is normal. This is the added height of the β€œAND” bitmap mask and the β€œXOR” bitmap, so for any normal icon it's just 2X the height of the icon. (These masks are no longer used for 32-bit icons, they are a delay.) Just split into two.

+8
source

Source: https://habr.com/ru/post/886847/


All Articles