在我的项目中,我使用用户之间的套接字进行通信,并且我必须将一个picturebox发送给另一个。将PictureBox发送到套接字上
这是我如何利用PictureBox:
PictureBox pictureBox1 = new PictureBox();
ScreenCapture sc = new ScreenCapture();
// capture entire screen, and save it to a file
Image img = sc.CaptureScreen();
// display image in a Picture control named pictureBox1
pictureBox1.Image = img;
我用我的套接字来发送这样的:
byte[] buffer = Encoding.ASCII.GetBytes(textBox1.Text);
s.Send(buffer);
,但我无法弄清楚如何我可以给你pictureBox1.Hope可以提前帮助,谢谢。
谢谢,但我怎么能显示这张照片给接收器?当接收器通过它s.rec eive()?因为我想让接收者看到发件人的屏幕截图 – user1902018
@ user1902018你试过了什么?您可以将字节读入内存流,然后将其设置为一个picturebox,基本上颠倒了发送它的过程。 –
其实我不知道该怎么做。你能举个例子吗? – user1902018