Search This Blog

Thursday, July 9, 2009

Load a image into picture box

OpenFileDialog odlg = new OpenFileDialog();
odlg.Title = "Select a Iamge file";
odlg.Filter = "Image File|*.jpg;*.bmp;*.gif|All File|*.*";
if (odlg.ShowDialog() != DialogResult.Cancel)
{
Application.DoEvents();
txt_ImageFile.Text = odlg.FileName;
Image img = Image.FromFile(odlg.FileName);

pictureBox1.Image = img;

}

No comments:

Post a Comment