Created
October 29, 2014 21:03
-
-
Save saramgsilva/dd748723f7e1860c67f0 to your computer and use it in GitHub Desktop.
[Windows Phone] How to convert byte array to BitmapImage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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