//回收資源
bm.Dispose();
g.Dispose();//改成下面的样子(不要释放你的 bitmap 对象,。)
if (pictureBox1.Image!=null)
{
Image img = pictureBox1.Image;
pictureBox1.Image=null;
img.Dispose();
}
pictureBox1.Image=bm;
g.Dispose;
bm.Dispose();
g.Dispose();//改成下面的样子(不要释放你的 bitmap 对象,。)
if (pictureBox1.Image!=null)
{
Image img = pictureBox1.Image;
pictureBox1.Image=null;
img.Dispose();
}
pictureBox1.Image=bm;
g.Dispose;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货