先引用System.IObyte[] byteimg = new byte[10000]; using (FileStream f = new System.IO.FileStream("c:\\mai.jpg",FileMode.Open)) { f.Read(byteimg,0,10000); MemoryStream m = new MemoryStream(byteimg); Bitmap bitmap = new Bitmap(m,false); this.pictureBox1.Image = bitmap; }
this.zxwd_yuan_pictureBox.Image = Image.FromFile(openfilename);是连接图片文件的
else
{
this.zxwd_yuan_pictureBox.Image = null;
System.IO.File.Delete(delpath);
}
这种方法根本行不通啊.仍然是有另一个进程在使用那个图片.还麻烦你再帮我想想.
using (FileStream f = new System.IO.FileStream("c:\\mai.jpg",FileMode.Open))
{
f.Read(byteimg,0,10000);
MemoryStream m = new MemoryStream(byteimg);
Bitmap bitmap = new Bitmap(m,false);
this.pictureBox1.Image = bitmap;
}