Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 8 找不到该组件。在windows phone 8应用程序中将流设置为位图图像时(HRESULT:0x88982F50的异常)_Windows Phone 8 - Fatal编程技术网

Windows phone 8 找不到该组件。在windows phone 8应用程序中将流设置为位图图像时(HRESULT:0x88982F50的异常)

Windows phone 8 找不到该组件。在windows phone 8应用程序中将流设置为位图图像时(HRESULT:0x88982F50的异常),windows-phone-8,Windows Phone 8,我试图在xml中现有的独立文件夹中添加一个元素 代码: 最有可能的情况是,我保存的文件格式不正确,无法检索 请帮忙 为什么不使用SaveJpeg扩展方法来创建byte数组 这个可能对你有帮助 解决了这个问题: 在保存字节数组时,它被编码为读取时无法识别的格式,因此我所做的是将其保存为字符串。因此,更新的代码是: else { string tileName = null; s

我试图在xml中现有的独立文件夹中添加一个元素 代码:

最有可能的情况是,我保存的文件格式不正确,无法检索


请帮忙

为什么不使用
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