Load a byte[] into an Image at Runtime

后端 未结 4 1325
醉话见心
醉话见心 2021-01-11 13:09

I have a byte[] that is represented by an Image. I am downloading this Image via a WebClient. When the WebClient

4条回答
  •  失恋的感觉
    2021-01-11 13:22

    You can use a BitmapImage, and sets its StreamSource to a stream containing the binary data. If you want to make a stream from a byte[], use a MemoryStream:

    MemoryStream stream = new MemoryStream(bytes);
    

提交回复
热议问题