Created
October 29, 2014 21:06
-
-
Save saramgsilva/77d1b86b847393cd976e to your computer and use it in GitHub Desktop.
[Windows Phone] How to convert byte array to WriteableBitmap
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 the specified image. | |
/// </summary> | |
/// <param name="image">The image.</param> | |
/// <returns>The WriteableBitmap</returns> | |
public static WriteableBitmap ConvertToWriteableBitmap(byte[] image) | |
{ | |
var bitmapImage = new BitmapImage(); | |
var memoryStream = new MemoryStream(image); | |
bitmapImage.SetSource(memoryStream); | |
return new WriteableBitmap(bitmapImage); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment