When do you dispose GDI+ resources?

隐身守侯 提交于 2019-12-04 02:54:38

In general, if the class is IDisposable, you must call the .Dispose method when the object is not needed.

Also, the MSDN library says:

Modifying the Region object returned by the Clip property does not affect subsequent drawing with the Graphics object. To change the clip region, replace the Clip property value with a new Region object.

Which means, you MUST dispose oldRgn.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!