C# Image.Clone Out of Memory Exception

前端 未结 6 740
礼貌的吻别
礼貌的吻别 2020-11-28 11:15

Why am I getting an out of memory exception?

So this dies in C# on the first time through:

splitBitmaps.Add(neededImage.Clone(rectDimensions, neededI

6条回答
  •  忘掉有多难
    2020-11-28 11:31

    I got this too when I tried to use the Clone() method to change the pixel format of a bitmap. If memory serves, I was trying to convert a 24 bpp bitmap to an 8 bit indexed format, naively hoping that the Bitmap class would magically handle the palette creation and so on. Obviously not :-/

提交回复
热议问题