【问题标题】:Deserialize Uri to WriteableBitmap将 Uri 反序列化为 WriteableBitmap
【发布时间】:2016-10-12 14:59:49
【问题描述】:

我像Uri 一样序列化了我的图像,但我在反序列化方面遇到了麻烦

var storageFile = await StorageFile.GetFileFromPathAsync(temp[0].BackStage.AbsoluteUri);
 using (var stream = await storageFile.OpenReadAsync())
 {
  await BackStageImg.SetSourceAsync(stream);
 }

此代码不起作用,当我尝试将 Uri 放入 StorageFile 时,它显示“您没有访问权限”

【问题讨论】:

    标签: c# json serialization uwp


    【解决方案1】:

    我将我的文件复制到App Local Folder 并点赞

    StorageFile localFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appdata:///local/background"));
    

    【讨论】:

      猜你喜欢
      • 2011-12-09
      • 1970-01-01
      • 1970-01-01
      • 2021-10-15
      • 2016-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-28
      相关资源
      最近更新 更多