Skip to content

Instantly share code, notes, and snippets.

@saramgsilva
Created October 29, 2014 21:06
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/77d1b86b847393cd976e to your computer and use it in GitHub Desktop.
Save saramgsilva/77d1b86b847393cd976e to your computer and use it in GitHub Desktop.
[Windows Phone] How to convert byte array to WriteableBitmap
/// <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