/// <summary> /// IPTC ändern. /// Übergeben wird der Img-Pfad und die Objekt-Nr. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Btn_ChangeIPTC_click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(imgPath) == true) { System.Windows.Forms.MessageBox.Show("Bitte zunächst ein Bild auswählen!"); return; } string objNr = myModID.ToString() + "-" + myVarID.ToString(); ShowIPTC iptcchange = new ShowIPTC(imgPath + "*" + objNr); iptcchange.ShowDialog(); }
private void Btn_Img_new(object sender, RoutedEventArgs e) { if (myImgCount == 0) { SaveGD(); } string curName = null; OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "Bilder einfügen"; ofd.Filter = "Image Files(*.PNG; *.JPG;| *.PNG; *.JPG| All files(*.*) | *.*"; ofd.RestoreDirectory = true; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //FilePath = ofd.FileName; //System.Windows.Forms.MessageBox.Show(FilePath); Admin.Admin.cName = System.IO.Path.GetFileName(ofd.FileName); myImgCount += 1; String _NewName = myVarID.ToString() + "#" + myImgCount + System.IO.Path.GetExtension(ofd.FileName); string NewName = System.IO.Path.Combine(Admin.Admin.ImgPath, _NewName); // System.Windows.Forms.MessageBox.Show(NewName); try { File.Copy(ofd.FileName, NewName); curName = System.IO.Path.GetFileName(NewName); //den alten FileName speichern //ImgHandling.myIPTCDaten.iSpezial = cFileName; //ImgHandling.IPTCDaten.WriteIPTC(cName); PictureList selPicture = new PictureList(curName); imgListBox.ItemsSource = selPicture; LblImgCount.Content = "Zugehörige Bilder: " + myImgCount.ToString(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Bild bereits vorhaden!" + Environment.NewLine + ex.Message); } string objNr = myModID.ToString() + "-" + myVarID.ToString(); string cImg = System.IO.Path.Combine(Admin.Admin.ImgPath, curName); ShowIPTC iptcchange = new ShowIPTC(cImg + "*" + objNr); iptcchange.ShowDialog(); ShowMetaDaten(curName); } }