2017-06-12 81 views

回答

0

我发现这个 [http://www.emgu.com/forum/viewtopic.php?t=1057]

public Image<Bgr, Byte> byteArrayToImage(byte[] byteArrayIn) 
{ 
MemoryStream ms = new MemoryStream(byteArrayIn); 
Bitmap returnImage = Image.FromStream(ms); 

return new Image<Bgr, byte>(returnImage); 
// you probably need to clean up stuff like the bitmap and the stream... 
} 

在emgu论坛,并重新输入它来删除一个变量名错字。假设你的字节数组是一个标准的图像,看起来像你可以加载到一个标准的图像变量,会自动找出大小。从那里你可以将该图像传递给你的emgu图像的构造函数。

+0

Works fine !!!但是,必须添加从图像到位图的投射: 位图returnImage =(位图)Image.FromStream(ms); – asegurpe