3 Replies - 2465 Views - Last Post: 02 September 2010 - 10:32 PM Rate Topic: -----

#1 kareem_3d  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 40
  • Joined: 13-July 10

How to use size mode in pictureBox

Posted 02 September 2010 - 08:36 AM

I made a pictureBox array and i've put an image in it but i can't shrunk it to fit the pictureBox size ???

I wrote this code but it didn't work :
        PictureBox[] replayed = new PictureBox[1000];
        private void Form1_Load(object sender, EventArgs e)
        {
            replayed[1] = new PictureBox();
            replayed[1].BackgroundImage = Image.FromFile(ImagePath);
            replayed[1].Location = new Point(50, 50);
            replayed[1].Size = new Size(100, 100);
            replayed[1].SizeMode=PictureBoxSizeMode.StretchImage;
            Controls.Add(replayed[1]);
        }


Is This A Good Question/Topic? -1
  • +

Replies To: How to use size mode in pictureBox

#2 kareem_3d  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 40
  • Joined: 13-July 10

Re: How to use size mode in pictureBox

Posted 02 September 2010 - 10:08 AM

No replay !!!
Was This Post Helpful? -1
  • +
  • -

#3 Robin19  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 272
  • View blog
  • Posts: 552
  • Joined: 07-July 10

Re: How to use size mode in pictureBox

Posted 02 September 2010 - 11:47 AM

No, I did not replay this message :P

Google search: "C# resize image dream in code"

First link: Scale an image to fit PictureBox dimension snipet

Cost: You owe PsycoCoder one Kudos.
Was This Post Helpful? 1
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: How to use size mode in pictureBox

Posted 02 September 2010 - 10:32 PM

I just have to ask...



replayed[1].SizeMode=PictureBoxSizeMode.StretchImage;


Did you even *try* to experiment a little with this? After all, there are only 4 modes in PictureBoxSizeMode. How long would it have taken to try each one and learn what the photo looks like at that mode.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1