如何使用TCP将图像从form1中的picturebox传输到form2中的picturebox? [英] How to transfer image from picturebox in form1 to picturebox in form2 using TCP?

查看:48
本文介绍了如何使用TCP将图像从form1中的picturebox传输到form2中的picturebox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在单个窗口中有两种形式每种形式的应用程序和图片框。如何使用TCP帮助解决方案将图像从form1中的picturebox传输到form2中的picturebox。



提前感谢

解决方案

Soooo .....首先,你不会为此获得一个现成的解决方案,因为你在同一个应用程序中的传输方法是完全荒谬的,并且为了这么简单的事情而付出太多的努力你需要在同一个应用程序中实现TCP服务器和客户端才能阻止自己这样做:




 Dim form2 As New Form2 
form2.SetPictureBoxImage(PictureBox1.Image)



和Form2。 ..

 Public Sub SetPictureBoxImage(image as Bitmap)
PictureBox2.Image = image
End Sub


I have two forms in single windows Application and picturebox in each form. How to transfer image from picturebox in form1 to picturebox in form2 using TCP help with solution.

Thanks in advance

解决方案

Soooo.....first, you''re NOT going to get a ready made solution for this as you''re transport method in the same application is utterly ridiculous and WAY TOO MUCH work for something so simple to do.

You''re saying you want to implement a TCP server and client in the same application just so you can stop yourself from doing this:

Dim form2 As New Form2
form2.SetPictureBoxImage(PictureBox1.Image)


and in Form2...

Public Sub SetPictureBoxImage(image As Bitmap)
    PictureBox2.Image = image
End Sub


这篇关于如何使用TCP将图像从form1中的picturebox传输到form2中的picturebox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆