Windows phone 8 找不到该组件。在windows phone 8应用程序中将流设置为位图图像时(HRESULT:0x88982F50的异常)
我试图在xml中现有的独立文件夹中添加一个元素 代码: 最有可能的情况是,我保存的文件格式不正确,无法检索Windows phone 8 找不到该组件。在windows phone 8应用程序中将流设置为位图图像时(HRESULT:0x88982F50的异常),windows-phone-8,Windows Phone 8,我试图在xml中现有的独立文件夹中添加一个元素 代码: 最有可能的情况是,我保存的文件格式不正确,无法检索 请帮忙 为什么不使用SaveJpeg扩展方法来创建byte数组 这个可能对你有帮助 解决了这个问题: 在保存字节数组时,它被编码为读取时无法识别的格式,因此我所做的是将其保存为字符串。因此,更新的代码是: else { string tileName = null; s
请帮忙 为什么不使用
SaveJpeg
扩展方法来创建byte
数组
这个可能对你有帮助
解决了这个问题:
在保存字节数组时,它被编码为读取时无法识别的格式,因此我所做的是将其保存为字符串。因此,更新的代码是:
else
{
string tileName = null;
string url = null;
string key = null;
string tilePicString = null;
XDocument loadedData;
System.Windows.Media.Imaging.BitmapImage imgSource = new System.Windows.Media.Imaging.BitmapImage();
if (appList != null)
{
foreach (AppTile app in appList)
{
tileName = app.TileName;
url = app.Url;
key = app.Key;
//changed here
tilePicString = System.Convert.ToBase64String(app.TilePic);
}
//same code as above
实际上,我正在通过一个服务调用对对象applist进行GWT…该调用已经将xml的结构(通过序列化)设置为
MemoryStream imgStream = new MemoryStream(NewApp.TilePic);//NewApp is AppTile type
BitmapImage imgSource = new BitmapImage();
imgSource.SetSource(imgStream);//here i get error
img.Source = imgSource;
else
{
string tileName = null;
string url = null;
string key = null;
string tilePicString = null;
XDocument loadedData;
System.Windows.Media.Imaging.BitmapImage imgSource = new System.Windows.Media.Imaging.BitmapImage();
if (appList != null)
{
foreach (AppTile app in appList)
{
tileName = app.TileName;
url = app.Url;
key = app.Key;
//changed here
tilePicString = System.Convert.ToBase64String(app.TilePic);
}
//same code as above