If you want to browse and display picture inside a picture box on your windows form you can try something like this:
Design of the form:
Code:
public PictureDisplay()
{
InitializeComponent();
}
private void btnBrowse_Click(object sender, EventArgs e)
{
OpenFileDialog newDialog = new OpenFileDialog();
if (newDialog.ShowDialog() == DialogResult.OK)
{
try
{
picBoxDisplay.Load(newDialog.FileName);
picBoxDisplay.SizeMode = PictureBoxSizeMode.Zoom;
}
catch
{
MessageBox.Show("Wrong file type!", "Error");
}
}
}
Code opens file dialog and if you choose a file of image type it's displayed to fit into a picture box while maintaining resolution ratio. If any other type is chosen MessageBox pops and makes you aware of an error.
Results:
Hopefully it covers the image upload to GUI part. For any further help, please explain the question better, thanks!