Bitmap to int[] using Marshal.Copy()

前端 未结 2 1724
一向
一向 2021-01-13 04:17

I\'m using Marshal.Copy() to copy the pixel information from a Bitmap to an int[] array, the problem resides in the fact that the info

2条回答
  •  -上瘾入骨i
    2021-01-13 05:11

    Those values are perfectly normal. They are 32bpp pixels with the alpha channel at 0xff, the usual value. In other words: -8682109 == 0xff7b8583. Any alpha value >= 128 will make the value negative because it sets the sign bit.

    Using uint[] instead of int[] can make that easier to see.

提交回复
热议问题