删除PictureBox使用的图像 [英] delete an image used by a PictureBox
本文介绍了删除PictureBox使用的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何删除PictureBox使用的图像,我尝试过:
How to delete an Image used by a PictureBox,I tried:
PictureBox1.Image.Dispose();
PictureBox1.Image = null;
然后尝试删除它,但是代码不起作用.请帮助
And then tried to delete it,but code didn''t work.Please Help
推荐答案
在上调用的 Dispose()方法 PictureBox1 的> Image 属性进行处理(删除/释放由图像保留的内存),因此无需再次删除该图像.
以下链接在这方面可能会有所帮助
> http://stackoverflow.com/questions/2808753/right-way- to-dispose-image-bitbit-and-picturebox [ ^ ]
The Dispose() method called on Image property of PictureBox1 disposes (deletes / releases memory held by the image), hence there is no need to delete the image again.
The following link may be helpful in this regard
http://stackoverflow.com/questions/2808753/right-way-to-dispose-image-bitmap-and-picturebox[^]
这篇关于删除PictureBox使用的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文