FileStream fs = new FileStream(@"F:\收藏的一些图片\1_uncarman.jpg.gif", FileMode.Open, FileAccess.Read);
Byte[] btye = new byte[fs.Length];
fs.Read(btye, 0, Convert.ToInt32(fs.Length));
System.IO.MemoryStream imagememorystream = new MemoryStream(btye);
Image i = Image.FromStream(imagememorystream);
this.pictureBox1.Width = i.Width;
this.pictureBox1.Height = i.Height;
this.pictureBox1.Image = i;
写的一个图片和二进制之间进行转换的函数 图片大概只有七十多K但是计算机要把二进制连接起来的时候要运算很长时间 性能不好
本文介绍了一个用于图片二进制转换和优化显示的函数实现,通过使用FileStream、MemoryStream和Image类,实现从文件读取二进制数据并高效地在PictureBox中展示图片。尽管图片大小为70多KB,但在处理过程中存在性能瓶颈,提示了优化的可能性。

被折叠的 条评论
为什么被折叠?



