C# Image.Clone Out of Memory Exception

前端 未结 6 715
礼貌的吻别
礼貌的吻别 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:36

    I found that I was using Image.Clone to crop a bitmap and the width took the crop outside the bounds of the original image. This causes an Out of Memory error. Seems a bit strange but can beworth knowing.

提交回复
热议问题