Change the image source in your Windows phone

I'm developing a metronome app, I've created a bunch of images to display the rhythm number, but I don't know how to load the images in the first place if I even need to. I've tried with this:

tactImgList[0] = new BitmapImage(new Uri("Assets/Images/1.png"));

      

And so on, but I always get a URI format exception.

What am I doing wrong? I tried to solve my problem but nothing.

+3


source to share


1 answer


You must specify the full path to the file starting with "ms-appx: ///".



tactImgList[0] = new BitmapImage(new Uri(@"ms-appx:///Assets/Images/1.png");

      

+2


source







All Articles