Wpf中,如何根据图像的元数据,加载到image控件,显示图像??

2025-05-01 05:35:12
推荐回答(1个)
回答1:

// 创建 BitmapImage 类
var bi = new BitmapImage();

bi.BeginInit();
bi.StreamSource = new System.IO.MemoryStream(imgdata);
bi.EndInit();

// 设置 Image 控件的 Source 属性为 BitmapImage
ImageControl.Source = bi;