更新时间:2023-12-05 14:48:16
您处理图形
?此外,它在处置你的形象就像你提到的,那么你就需要确保它被取出的ImageList,或者你将造成更多的问题。什么是什么格式的图像?
Are you disposing graphics
? Also, it you dispose your image like you mentioned then you would need to make sure it is taken out of the ImageList or you will cause more issues. What what format are the images?
在一般来说,当你的内存不足问题图像时参与,您的问题将是要么一些方法不喜欢一些图像格式,或9/10的时候,你误解了图形对象中的一个的生命周期。
In general when you get out of memory issues when images are involved, your issue will be either some method does not like some image format, or 9/10 times, you misunderstood the lifecycle of one of the graphic objects.
图形
用法并把它们放在使用
块。图片
生命周期,并小心复制它们,处理它们,收盘底层流等。Graphics
usage and put them in using
blocks.Image
life cycle and be careful with copying them, disposing them, closing underlying streams, etc.编辑:
下面是我能找到,使用***的选择的 ImageList.Draw (图形,X,Y,宽度,高度,指数)
。这将使用内部处理,而不是创建影像的副本。
Here is the best option I can find, use ImageList.Draw(graphics, x, y, width, height, index)
. This will use the internal handle instead of creating a copy of the image.