Image.FromStream() method returns Invalid Argument exception

前端 未结 10 2488
臣服心动
臣服心动 2020-11-29 09:18

I am capturing images from a smart camera imager and receiving the byte array from the camera through socket programming (.NET application is the client, camera is the serve

10条回答
  •  时光取名叫无心
    2020-11-29 10:19

    Try this:

    public Image byteArrayToImage(byte[] item)
    {          
       Image img=Image.FromStream(new MemoryStream(item)); 
       img.Save(Response.OutputStream, ImageFormat.Gif);
       return img;
    }
    

    Hope it helps!

提交回复
热议问题