C# bitmap images, byte arrays and streams!

后端 未结 5 659
醉梦人生
醉梦人生 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:13

    I have had problems loading images in .NET that were openable by more robust image libraries. It's possible that the specific jpeg image you have is not supported by .NET. jpeg files are not just one type of encoding, there's a variety of possible compression schemes allowed.

    You could try it with another image that you know is in a supported format.

提交回复
热议问题