【发布时间】:2017-12-12 01:20:00
【问题描述】:
我正在尝试将字节数组转换为图像。网上有很多参考资料可以这样做,例如 this SO post 和 this emgu forum 和 emgu official docs。
但是,当我根据 SO 帖子和 Emgu 文档实施解决方案时出现错误
无法从 System.Drawing.Bitmap 转换为 byte[*,*,*,*]
public Image<Bgr, Byte> CreateImageFromBytesArray(byte[] bytes)
{
using (var ms = new MemoryStream(bytes))
{
Bitmap bmp = new Bitmap(ms);
Image<Bgr, Byte> img = new Image<Bgr, Byte>(bmp); //EXCEPTION HERE
return img;
}
}
关于如何进行这项工作的任何建议?
【问题讨论】:
-
哪一行出现异常?
-
见上面的代码