2015-02-09 60 views

回答

1

允许在XAML文件中的Image,如:

 <Image Name="img"/> 

现在,从资产分配的source在代码文件,如:

 img.Source = new BitmapImage { UriSource = new Uri("/Assets/text1.png", UriKind.Relative) }; 

完蛋了。

+0

'System.ArgumentException'类型的异常 给定的System.Uri无法转换为Windows.Foundation.Uri。 – 2015-02-09 08:56:32

+0

使用替换或绝对的替换或相对URI 'Flag.Source = new BitmapImage {UriSource = new Uri(“ms-appx:/// Flags /”+ Flags.list [flagIndex] .filename +“.png”,UriKind .Absolute)};' 它像一个魅力。 非常感谢您回答这样的原始问题。 – 2015-02-09 09:02:46

相关问题