Reputation: 14204
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: Load a byte[] into an Image at Runtime. I was not specific enough in my original question, but the answers were still relevant.
Upvotes: 2
Views: 4916
Reputation: 82335
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
Upvotes: 0