UWP - Image Uri in Application Folder

前端 未结 5 1339
自闭症患者
自闭症患者 2020-12-10 10:51

I\'m having a little issue here in showing images.

So when I\'m trying to load images from XAML, I can use a relative uri to the image source like this :

<         


        
5条回答
  •  悲哀的现实
    2020-12-10 11:31

    You can also use it with BaseUri.

    BitmapImage bitmapImage = new BitmapImage(new Uri(this.BaseUri, "/Assets/image.jpg"));
    

    Assets is a folder name and you can change it with your any custom folder name :)

提交回复
热议问题