RowLength = 4 * ((bmch.bcWidth * bmch.bcBitCount + 31) / 32)

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Mentioned in "WINDOWS programming" chapter fifteenth: in a byte calculation formula of each row of unit of a DIB length: RowLength = 4 * ((bmch.bcWidth * bmch.bcBitCount + 31) / 32); when I read here produced when a question: why must be 4 bytes (again or why must be 32)? Why not 64? Or why not directly on the size itself to operate? When you see 32, 64 you have not thought of operating system we use, We usually use the operating system is not 32 or 64., What is the relationship between the me?

Yes, it is because of the reason of operating system. When using the 32/64 operating system, each time the computer read / write a unit is 32/64. It is clear, not the length of 32 /64, when the length is not a multiple of 4 bytes itself, when read additional computation (such as read each byte).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Nick at December 04, 2013 - 1:05 PM