【发布时间】:2015-06-18 16:44:55
【问题描述】:
我正在尝试在 Windows Universal 应用程序中为我的图像定义来源,但它给了我以下错误:
无效的 URI:无法确定 URI 的格式。
imagePath = "Assets/Category-other-dark.png";
Uri uri = new Uri(imagePath, UriKind.Absolute);
ImageSource imgSource = new BitmapImage(uri);
imgCategory.Source = imgSource;
我搜索了很多论坛并尝试了很多东西,但没有任何效果。谢谢。
【问题讨论】:
-
我尝试了那篇文章中写的内容。
-
您的 png 位置在哪里?应用包还是应用数据?
标签: c# windows windows-phone win-universal-app