first we should open new windows application project
then we have to add a PictureBox , a button , OpenFileDialog.
Button1:
name = btnopen
text = open image
Button2:
name : Exit
Text : Exit
PictureBox:
name = imgloader
Size Mode : Streach
OpenFileDialog:
name : open
Filter : (you can add any format but dont forget it should be Pictures formats)
double click in the button1 and write the Code
private void btnopen_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
{
imgloader.Image = Image.FromFile(openFileDialog1.FileName);
}
}
|
then double click to button2 and write:
Finish
just open the project and test it