发送,接收图片问题!!
发送端:MemoryStream ms = new MemoryStream();
Image img = pictureBox1.Image;
img.Save(ms, ImageFormat.Jpeg);
byte[] data = ms.ToArray();
ms.Write(data, 0, data.Length);
ms.Close();
这样写对不对??
接收端:
byte[] data = new byte[199999];
Int32 bytes = stream.Read(data, 0, data.Length);
怎么把接收的数据赋给pictureBox?? --------------------编程问答-------------------- 接收端再把流转换为img啊 --------------------编程问答-------------------- Image.FromStream --------------------编程问答-------------------- string strPath = @"E:\32323.bmp";
FileStream stream1 = File.Create(strPath);
byte[] see存放接收到的图像数据
stream1.Write(see, 0, see.Length);
stream1.Close();
然后把图片赋给picturebox --------------------编程问答-------------------- 或者
byte[] see存放接收到的图像数据
MemoryStream ms = new MemoryStream(see);
System.Drawing.Image image = Image.FromStream(ms);
--------------------编程问答-------------------- 既然你是二进制 就先转换了在给 pictureBox 赋值
补充:.NET技术 , C#