CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Posts
    23

    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

  2. #2
    Join Date
    May 2002
    Posts
    1,435

    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.

  3. #3
    Join Date
    Mar 2005
    Posts
    23

    Thumbs up Re: Two extra bytes at end of each bitmap row.

    0xC0000005, thank you for the explanation. That really clears things up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured