标签:
CODE
private BitmapImage ReturnBitmap(string destFile) { // Read byte[] from png file BinaryReader binReader = new BinaryReader(File.Open(destFile, FileMode.Open)); FileInfo fileInfo = new FileInfo(destFile); byte[] bytes = binReader.ReadBytes((int)fileInfo.Length); binReader.Close(); // Init bitmap BitmapImage bitmap = new BitmapImage(); bitmap.BeginInit(); bitmap.StreamSource = new MemoryStream(bytes); bitmap.EndInit(); return bitmap; }
标签:
原文地址:http://www.cnblogs.com/oiliu/p/5512802.html