【问题标题】:How i can display image from the Absolute Uri(C:\1.jpg) source in XAML WinRT我如何在 XAML WinRT 中显示来自 Absolute Uri(C:\1.jpg) 源的图像
【发布时间】:2015-08-23 10:20:57
【问题描述】:

我尝试以不同的方式解决这个问题,如下所示:

XAML:

<Image Name="immage" Grid.Row="1" Grid.Column="1" Source="{Binding UrlString}"/>

XAML.CS:

this.UrlString = new Uri("D:/1.jpg", UriKind.Absolute).AbsoluteUri;

当我像这样设置相对 Uri 时,我只显示我的图像:“/Assets/1.jpg” 但我想使用 Absolute Uri,请帮帮我。

【问题讨论】:

    标签: c# xaml windows-runtime


    【解决方案1】:

    您不能在 Windows 运行时应用程序中使用绝对 Uri,例如“C:\1.jpg”或“D:\1.jpg”。默认情况下,应用可以访问某些文件系统位置。

    File access and permissions (Windows Runtime apps)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多