说明ms有问题,首先确保有读到数据,这种情况是保存到库的时候出错的。

原来你可能是这样写的:

MemoryStream stream = new MemoryStream();
PictureBox1.Image.Save(stream, ImageFormat.Bmp ); //这里出错,原图片格式是JPEG
byte [] bytestream = new byte [ stream.Length ];
stream .Read (bytestream ,0,bytestream .Length );
stream.Flush();

应该为:

MemoryStream stream = new MemoryStream();
PictureBox1.Image.Save(stream,PictureBox1 .Image .RawFormat );
byte[] bytestream = stream.ToArray();
stream.Flush();

相关文章:

  • 2022-03-03
  • 2021-07-15
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-06-14
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案