标签:
private void ShowSelectedPicture(string path) { FileStream fs = File.OpenRead(path); //OpenRead int filelength = 0; filelength = (int)fs.Length; //获得文件长度 Byte[] image = new Byte[filelength]; //建立一个字节数组 BitmapImage bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.StreamSource =new MemoryStream(image ); bitmapImage.EndInit(); var pictureWindow = new PictureWindow(); pictureWindow.myImage.Source = bitmapImage; //pictureWindow.myImage.Width = bitmapImage.PixelWidth; //pictureWindow.myImage.Height = bitmapImage.PixelHeight; pictureWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; pictureWindow.ShowDialog(); }
标签:
原文地址:http://www.cnblogs.com/wangboke/p/5629437.html