嘿家伙我试图得到一个图片,在图片框上,以获得它在另一个表格图片框。 [英] hey guy am trying to get an image which is on a picturebox to get it on another form picturebox.

查看:90
本文介绍了嘿家伙我试图得到一个图片,在图片框上,以获得它在另一个表格图片框。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



嘿家伙正在尝试获取一个在图片盒上的图像

来获取另一个表格图片框。



i在form1上有一个picturebox,这是pictureBox1

我得到了带有pictureBox3的form2,我希望pictureBox1上的图像显示在form2上的form2上



i试过这段代码

pictureBox3.Image.Clone = new Form1.picturebox1.image();


hey guy am trying to get an image which is on a picturebox
to get it on another form picturebox.

i got a picturebox on form1 which is pictureBox1
and i got form2 with pictureBox3 and i want the image which is on pictureBox1 to show on PictureBox3 on form2

i have tried this code
pictureBox3.Image.Clone = new Form1.picturebox1.image();

推荐答案

在Form2上创建一个属性,在其上设置Image的PictureBox:

Create a property on Form2 which sets the Image on it''s PictureBox:
public Image Image
   {
   get { return myPictrueBox.Image; }
   set { myPictureBox.Image = value; }
   }

然后通过在Form1中创建的Form2实例设置它:

Then set it via the instance of Form2 that you create in Form1:

Form2 f = new Form2();
f.Image = myForm1PictureBox.Image;
f.ShowDialog();


这篇关于嘿家伙我试图得到一个图片,在图片框上,以获得它在另一个表格图片框。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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