Skip to content

Instantly share code, notes, and snippets.

Created October 17, 2016 01:52
What would you like to do?
Create BitmapSource by specifying a format from the byte sequence
public static BitmapSource CreateFormJpeg(byte[] bytes)
using (var stream = new MemoryStream(bytes))
var decoder = new JpegBitmapDecoder(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
return decoder.Frames[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment