Skip to content

Instantly share code, notes, and snippets.

@saramgsilva
Created October 29, 2014 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saramgsilva/dd748723f7e1860c67f0 to your computer and use it in GitHub Desktop.
Save saramgsilva/dd748723f7e1860c67f0 to your computer and use it in GitHub Desktop.
[Windows Phone] How to convert byte array to BitmapImage
/// <summary>
/// Converts to bitmap image.
/// </summary>
/// <param name="image">The image.</param>
/// <returns>the bitmap image</returns>
public static BitmapImage ConvertToBitmapImage(byte[] image)
{
var bitmapImage = new BitmapImage();
var memoryStream = new MemoryStream(image);
bitmapImage.SetSource(memoryStream);
return bitmapImage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment