C# bitmap images, byte arrays and streams!

后端 未结 5 660
醉梦人生
醉梦人生 2021-01-25 17:12

I have a function which extracts a file into a byte array (data).

        int contentLength = postedFile.ContentLength;
        byte[] data = new byte[contentLen         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-25 17:40

    Any reason why you don't simply do this:

    Image bitmap = Image.FromStream(postedFile.InputStream);
    

提交回复
热议问题