Dimensions of an image in the picture box

  • Thread starter Thread starter Frank Rizzo
  • Start date Start date
F

Frank Rizzo

How can I retrieve the dimentions of the image that's been loaded into a
picture box?

Thanks
 
Frank Rizzo said:
How can I retrieve the dimentions of the image that's been loaded into a
picture box?

Thanks

Read the pictureBox1.Image.Size.Width/Height properties. Here is a snippet:

--- code ---
private void Form1_Load(object sender, System.EventArgs e)
{
label1.Text = pictureBox1.Image.Size.Width.ToString();
label2.Text = pictureBox1.Image.Size.Height.ToString();
}
--- end code ---

Good Luck,

carl
 
Back
Top