Why must “stride” in the System.Drawing.Bitmap constructor be a multiple of 4?

后端 未结 6 1587
悲&欢浪女
悲&欢浪女 2020-11-22 12:32

I am writing an application that requires me to take a proprietary bitmap format (an MVTec Halcon HImage) and convert it into a System.Drawing.Bitmap in C#.

The only

6条回答
  •  隐瞒了意图╮
    2020-11-22 13:06

    Remember stride is different from width. You can have an image that has 111 (8-bit) pixels per line, but each line is stored in memory 112 bytes.

    This is done to make efficient use of memory and as @Ian said, it's storing the data in int32.

提交回复
热议问题