Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 App: Why must I specify ms-appx:/// in my image source URL?

Tags:

windows-8

I've been looking at the XAML Images sample project and the XAML to load an image in that sample looks like this:

<Image Source="Assets/image1.jpg"/>

However, in my own project I find that I cannot load any images like that. If I try I get E_NETWORK_ERROR when I handle the ImageFailed. Instead, I discovered that I have to use the ms-appx:/// prefix like this:

<Image Source="ms-appx:///Assets/image1.jpg"/>

Then it works. Any ideas what's different about my project vs the sample that would cause this?

like image 684
Skrymsli Avatar asked Oct 06 '12 22:10

Skrymsli


2 Answers

Have you tried "<Image Source="/Assets/image1.jpg>"?

like image 190
Brianswer Avatar answered Nov 07 '22 12:11

Brianswer


M working on Windows phone 8 at i used this.

OrderImage1.Source = new BitmapImage(new Uri("///Assets/images/order_bread.png"));

like image 26
Muhammad Avatar answered Nov 07 '22 12:11

Muhammad