【发布时间】:2016-11-11 04:56:54
【问题描述】:
我正在尝试将图像附加到图像源,但执行代码后图像未显示在我的页面中。
代码:
Bitmap bmp = (Bitmap)data.img;
MemoryStream ms = new MemoryStream();
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
ms.Position = 0;
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.StreamSource = ms;
bi.EndInit();
imgPhoto.Source = bi;
这是我想附加到 imhPhoto.Source 的 data.img 规范。
【问题讨论】: