如何还原图片?
如何将接受到的图片(此时接受到的是字节数组)还原?
byte[] picture=new byte[1024000];
System.IO.MemoryStream daodao=new MemoryStream(picture);
int i=0;
if(e.DTU.Data!="***&&&###")//定义的一个结束符,判断图片是否接受完
{
int j=0;
while(j<e.DTU.DateLength)
{ picture[i]=e.DTU.DataByte[j];i++;j++;}
}
{ daodao=new MemoryStream(picture);
this.pictureBox1.Image=new System.Drawing.Bitmap(daodao);
Image image=Image.FromStream(daodao,true);
this.pictureBox1.Image=image;
}
但这样是不行的?提示:无效的参数
各位给帮帮忙,给提示下