How can I copy the pixel data from a Bitmap with negative stride?

前端 未结 5 1572
眼角桃花
眼角桃花 2020-12-11 06:45

I was looking for the fastest way to convert a Bitmap to 8bpp. I found 2 ways:

1.

        public static System.Drawing.Image Conver         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 07:12

    I'm guessing the exception you're getting is due to

    this.data = new byte[-length];
    

    And then trying to copy data into a byte array of negative size (I don't see how that even compiles really...).

提交回复
热议问题