Bild via FolderBrowserDialog oder anderem in Picturebox laden

Alaitoc

Erfahrenes Mitglied
Hallo zusammen,
eine kleine Frage wie lade ich ein Bild mit einem FilebrowserDialog oder File... in eine Picturebox?
Gibt bestimmt ne simple Lösung, aber ich komm net drauf ^^

Schonmal ein großes THX :)
 
Hi

Ja gibt es ;)
C#:
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "JPEG | *.jpg";
if (ofd.ShowDialog() == DialogResult.OK)
{
      pictureBox.ImageLocation = ofd.FileName;
      // oder
      // pictureBox.Load(ofd.FileName);
}
 
Zurück