文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>关闭Image.FromFile(filePath)打开的文件

关闭Image.FromFile(filePath)打开的文件

时间:2011-04-04  来源:垂钓玄武

两种方法,思路一样的,做哥拷贝。。不懂为什么FromFile函数自己没做。

1 string   filenameOf   =   @ "D:\images\dao.gif "; 
2 FileStream fs = new FileStream(filenameOf,FileMode.Open, FileAccess.Read);
3 int byteLength = (int)fs.Length;
4 byte[] wf = new byte[byteLength];
5 fs.Read(wf,0,byteLength);
6 fs.Close();


1 Image   img   =   Image.FromStream(new   MemoryStream(wf)); 
2 this.pictureBox1.Image = img;
3
4 Image image = Image.FromFile(obj.FileName);
5 Image bmp = new Bitmap(image);
6 image.Dispose(); //这句话很重要
7 pictureBox1.Image = bmp;

相关阅读 更多 +
排行榜 更多 +
汉房手机版

汉房手机版

生活实用 下载
瓜子二手车检瓜子评估检测系统

瓜子二手车检瓜子评估检测系统

生活实用 下载
电e宝

电e宝

生活实用 下载