Bilder werden jetzt richtig geladen

This commit is contained in:
Husky
2018-07-21 08:11:15 +02:00
parent b8c8a6cbfa
commit ea3b8c564a
2 changed files with 46 additions and 21 deletions

View File

@@ -49,8 +49,7 @@ namespace SanSystem
{
//pt_box.Image = Image.FromFile(Path.Combine("temp",schacht.SavedBilders[0].Speicherpfad));
pt_box.Load(Path.Combine(schacht.SavedBilders[0].Speicherpfad));
pt_box.SizeMode = PictureBoxSizeMode.StretchImage;
}
}
@@ -110,5 +109,20 @@ namespace SanSystem
}
}
private void lb_pictures_SelectedIndexChanged(object sender, EventArgs e)
{
ListBox listBox = (ListBox)sender;
if (listBox == null) return;
int index = listBox.SelectedIndex;
string pfad = Path.Combine(schacht.SavedBilders[index].Speicherpfad);
if (!File.Exists(pfad))
{
MessageBox.Show("Bilddatei mit den Pfad " + pfad + " nicht gefunden");
}
pt_box.Load(pfad);
pt_box.SizeMode = PictureBoxSizeMode.StretchImage;
}
}
}