tags:

views:

1009

answers:

2

I have a byte[] that represents a .png file. I am downloading this .png via a WebClient. When the WebClient has downloaded the .png I reference via a URL, I get a byte[]. My question is, how do I load a byte[] into a System.Windows.Controls.Image element in WPF? Thank you.

Note: This is complementary to the question I asked here: http://stackoverflow.com/questions/582805/load-a-byte-into-an-image-at-runtime. I was not specific enough in my original question, but the answers were still relevant.

A: 

In addition to the answers you got on the other question.. which should work fine, you should also be able to create a BitmapImage object and set the UriSource to the web URI instead of using a webclient and then set the Image.Source to the BitmapImage.. See This

Quintin Robinson
+1  A: 

Use a PngBitmapDecoder. The docs show example usage.

Jon Skeet