Two extra bytes at end of each bitmap row.
Hello,
I wrote a function that reads the BITMAPFILEHEADER, then the BITMAPINFOHEADER, and finally the byte array containing the color values of a 24 bit bitmap into memory. Then, I saved the color values to a text document so that I could read the values to test the function. I eventually realized that each row of a bitmap has two bytes appended to the end of it. What I would like to know is the purpose of these two bytes. Thank you for your help.
dremmuel
Re: Two extra bytes at end of each bitmap row.
The extra bytes are there to make each row align to a DWORD memory address. The number will vary based on the length of the row and bits/pixel. A row of pixels with 8 or 16 b/p and a count divisible by 4, for example, will not have extra bytes.
Re: Two extra bytes at end of each bitmap row.
0xC0000005, thank you for the explanation. That really clears things up.