bmp转二进制:
FileStream fs = File.OpenRead(filepath); //filepath文件路径 Byte[] tempBuff = new Byte[fs.Length]; fs.Read(tempBuff, 0, tempBuff.Length);
二进制还原bmp
BitmapImage BI = new BitmapImage(); BI.BeginInit(); BI.StreamSource = new MemoryStream(bufPic); //bufPic是图片二进制,byte类型 BI.EndInit(); image_emp.Source = BI;//image_emp是图片控件