WPF(C#)中Bitmap与BitmapImage相互转换
原文: WPF(C#)中Bitmap与BitmapImage相互转换 版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangshubo1989/article/details/47296339 一、WPF的Image控件中设置ImageSource image1.Source = new BitmapImage(new Uri(@"image file path", Urikind.RelativeOrAbsolute)); 还可以使用: System.IO.FileStream fs = new System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read); byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); fs.Close(); fs.Dispose(); System.IO.MemoryStream ms = new System.I...