Load a byte[] into an Image at Runtime

后端 未结 4 1323
醉话见心
醉话见心 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:44

    In .Net framework 4.0

    using System.Drawing;
    using System.Web;
    
    private Image GetImageFile(HttpPostedFileBase postedFile)
    {
       if (postedFile == null) return null;
       return Image.FromStream(postedFile.InputStream);
    }
    

提交回复
热议问题