【发布时间】:2015-06-27 07:18:48
【问题描述】:
对于 Windows Phone 8 开发,我读到的所有内容都说您必须将流设置为位图图像的源,以便将 byte[] 数组转换为位图图像。但是,当我实施此操作时,我在以下位置收到错误:
bitmapImage.SetSource(stream);
错误:
An exception of type 'System.Exception' occurred in System.Windows.ni.dll
but was not handled in user code
Additional information: The component cannot be found. (Exception from
HRESULT: 0x88982F50)
代码片段:
byte[] bytes = value as byte[];
MemoryStream stream = new MemoryStream(bytes, 0, bytes.Length);
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(stream);
【问题讨论】:
标签: c# windows-phone-8 memorystream bitmapimage