Why are bmps stored upside down?

前端 未结 2 1298
天命终不由人
天命终不由人 2020-12-06 05:08

Why are BMP images stored upside down and zero-padded so they are four-byte aligned?

2条回答
  •  一向
    一向 (楼主)
    2020-12-06 05:47

    They are stored accordingly to a display coordinate system. (0, 0) is at the upper left corner. X (corresponds to width) goes from left to right. Y (corresponds to height) goes from up to bottom.

    As for "4 Byte question" see Why must "stride" in the System.Drawing.Bitmap constructor be a multiple of 4?

提交回复
热议问题