C# Image.Clone Out of Memory Exception

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

    Make sure that you're calling .Dispose() properly on your images, otherwise unmanaged resources won't be freed up. I wonder how many images are you actually creating here -- hundreds? Thousands?

提交回复
热议问题