【发布时间】:2013-09-23 14:26:30
【问题描述】:
我可以将图像绑定到 xaml 而不需要使用它所在的图像源(主要方法)(在 xaml 页面中):
<Image Height="170" Width="220" Source="{Binding Source=Img}" ></Image>
因为我有从字节数组转换的图像并且没有任何名称或来源。 喜欢这里:
Image Img = new Image();
Img=ByteArraytoBitmap(ob0[0].Img.ToArray());
public BitmapImage ByteArraytoBitmap(Byte[] byteArray)
{
MemoryStream stream = new MemoryStream(byteArray);
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(stream);
return bitmapImage;
}
【问题讨论】:
标签: image xaml windows-phone-7 binding windows-phone-8