Image.FromStream() method returns Invalid Argument exception

前端 未结 10 2493
臣服心动
臣服心动 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:15

    Maybe the image is embedded in an OLE field and you have to consider the 88 bytes OLE header plus payload:

    byteBlobData = (Byte[]) reader.GetValue(0);
    stream = new MemoryStream(byteBlobData, 88, byteBlobData.Length - 88);
    img = Image.FromStream(stream);
    

提交回复
热议问题