Im getting image from form1 picbox1 to new form picbox1 how to show it in fullscreen?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chocolade
    New Member
    • Aug 2010
    • 69

    Im getting image from form1 picbox1 to new form picbox1 how to show it in fullscreen?

    I have a new form. Now in form1 im showing images in picturebox1.

    Now i did a double click event of picturebox1 and when you click double on the picturebox1 its openning a new form.

    On the new form i added a split container on the right i added some labels buttons....on the left on panel1 i added a picturebox and did the picturebox to be Dock FILL!

    Now i created on the new form code a function that will get the images from form1 and put it in the new form picturebox1 on panel1.

    In the new form i want the picturebox1 to be on all over the panel1 thats why i set it to dock.FILL!
    But when i see the image in the new form i see it on the same size as it in form1 and only on the left corner of the new form.

    I want to see it in the new form all over panel1 thats why i did it DOCK FILL. But the image or the picturebox for some reason show the image only on the left corner side and not on all the panel1


    This is the code of the new form:

    Code:
    public PictureBox picturebox1(PictureBox pb1)
            {
                pictureBox1.Image = pb1.Image;
                return pictureBox1;
            }
    And this is what i did in form1:

    Code:
    private void pictureBox1_DoubleClick_1(object sender, EventArgs e)
            {
                
                    pb1_fs = new Picturebox1_Fullscreen();
                    pb1_fs.Show();
                    pb1_fs.WindowState = FormWindowState.Maximized;
                    pb1_fs.picturebox1(pictureBox1);
                    pb1_fs.FormClosing += new FormClosingEventHandler(pb1_fs_FormClosing);
                
            }

    Why the image in the new form isnt all over the panel1 area ? I thought if i did the picturebox1 in the new form to be dock fill on the panel1 it will show the image all over it but it dosent.
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    On a PictureBox, there's a SizeMode property that I believe you can set to either Stretch, or Zoom. Stretch will stretch the image to fit the PictureBox completely, ignoring aspect ratio. Zoom will maintain the aspect ratio so it may not fill the PictureBox completely, but it will make the image as large as possible.

    So on the PictureBox that you have filling the panel, set the SizeMode property to whatever is appropriate for you.

    Comment

    Working...