How to read an image from isolated storage and display it on an image element?

I need to load an image from IsolatedStorage and display it on a UIElement image. I examined the MSDN, and I found that I could not get the Uri from Inventory. I could get a stream for a saved jpeg image file.

After I get a stream of jpeg files, how do I show it on an Image element?

+3
source share
1 answer

Use BitmapImage.SetSource to read the stream, and then set Image.Source to BitmapImage:

Stream jpegStream;
var image1 = new BitmapImage();
image1.SetSource(jpegStream);
Image image = new Image();
image.Source = image1;
+4
source

All Articles