I don't know if this is the right place to show my question.
I can't understand why, in the BMP array after the headers, i find some zero
that aren't in the real BMP image. This zero are at the end of a single pixel
row. Sometime i find three zeros. I've seen, in a web page, that if a row
ins't a multiple of 4 it need to add one, two or three zeros to reach this
multiple of 4. I've tried to understand it but with no positive result.
Somebody can explain me how this work? If you know a code about it better.
james
Tamas Demjen - 23 May 2005 17:13 GMT
Each row starts at a DWORD (4-byte) boundary. Here's how to calculate
the size of each line in bytes:
(Width * BitsPerPixel + 31) / 32 * 4
where Width is the width in pixels, BitsPerPixel is 1, 4, 8, 16, 24, 32,
etc. (the biBitCount field in the header). The difference between the
minimum bytes and the actual bytes per row is
(Width * BitsPerPixel + 31) / 32 * 4 - (Width * BitsPerPixel + 7) / 8
and it's filled by all 0s.
Tom
> I don't know if this is the right place to show my question.
> I can't understand why, in the BMP array after the headers, i find some zero
[quoted text clipped - 5 lines]
>
> james