简体   繁体   中英

Changing an image's source in Windows phone

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

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

And so on the rest, but I'm always getting a URI format exception.

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

您应该以“ms-appx:///”开头提供文件的完整路径。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM