When reading an image from the Windows Store or Windows Phone SDK you are usually presented with a simple Stream. This can cause issues when you want to use the Stream for the Source of an image. In order to overcome this incompatibility you can take advantage of the versatile BitmapImage, it simply allows you to convert a stream to useable image source as follows:

Stream strm = GetStreamInformation();
var bi = new BitmapImage();
bi.SetSource(strm);
imgArtist.Source = bi; //Assuming you have a xaml define image here


Comment Section

Comments are closed.