working on it ...


Explore Public Snippets

Sort by

Found 1 snippet

    public by guantalamo56  113  0  5  0

    UWP: turn byte array into image

    Given a byte array, let's turn it into an Image that can be used in UWP UI contexts.
    public static async Task<Image> ToImage(this byte[] input)
    	if (input == null)
    		return null;
    	BitmapImage biSource = new BitmapImage();
    	using (InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream())
    		await stream.WriteAsync(input.AsBuffer());
    		await biSource.SetSourceAsync(stream);
    	return new Image { Source = biSource };

    List Complete ( 1 snippet total )

    Cannot find what you were looking for?
    Ask the Snip2Code Community

    • Public Snippets
    • Channels Snippets