简体   繁体   中英

Getting a Uri from a path in UWP

I'm using a service that saves images in my application inside paths that look like:

C:\\Users\\user\\AppData\\Local\\Packages\\43108ba3-ad13-4b7a-93b6-7ebdc6a91606_5gyrq6psz227t\\LocalState\\private\\image.jpg

I would like to show the images, but Image.Source requires a Uri.

How can I create a Uri for Image.Source based on that kind of paths?

I have tried with new Uri(new Uri("ms-appdata:///", "local/private/image.jpg")) , but it doesn't work :(

你应该能够使用new Uri("ms-appdata:///local/private/image.jpg")

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