public void imgLoad() { string _myUri = DNBDataHandling.GetCover(db); if (_myUri == null) { cbSaveCover.IsChecked = false; lbCoverDNB.Content = "Kein Conver vorhanden!"; return; } Image myImage = new Image(); myImage.Width = 200; // Create source myBitmapImage = new BitmapImage(); // BitmapImage.UriSource must be in a BeginInit/EndInit block myBitmapImage.BeginInit(); myBitmapImage.UriSource = new Uri(_myUri); // To save significant application memory, set the DecodePixelWidth or // DecodePixelHeight of the BitmapImage value of the image source to the desired // height or width of the rendered image. If you don't do this, the application will // cache the image as though it were rendered as its normal size rather then just // the size that is displayed. // Note: In order to preserve aspect ratio, set DecodePixelWidth // or DecodePixelHeight but not both. myBitmapImage.DecodePixelWidth = 200; myBitmapImage.EndInit(); //set image source MyImage.Source = myBitmapImage; }
private void Window_Loaded(object sender, RoutedEventArgs e) { //this.DataContext = newBook; //Hilfstabellen laden/aktivieren sett = new mySettings(); Admin.LoadGenre(ugridGenre); LoadAuxTab(); btnPublNew.Visibility = Visibility.Hidden; NameRolle nr = new NameRolle(); nr_list = new List <NameRolle>(); verl_list = new List <DnbVerlag>(); print_list = new List <DnbPrinter>(); var language = from lg in Admin.conn.Language orderby lg.Language1 select new { lng = lg.Language1, iso = lg.iso, id = lg.LanguageID }; cbLang.ItemsSource = language.ToList(); var bind = from b in Admin.conn.Bindung orderby b.SortBy select new { bnd = b.SortBy, id = b.BindingID }; cbBindung.ItemsSource = bind.ToList(); var typ = from t in Admin.conn.BuchTyp orderby t.SortBy select new { typ = t.SortBy, id = t.ID }; cbBuchTyp.ItemsSource = typ.ToList(); var sach = from s in Admin.conn.Sachgruppe orderby s.SortBy select new { sg = s.SortBy, id = s.GenreID }; cbSachgruppe.ItemsSource = sach.ToList(); var sto = from st in Admin.conn.Standort orderby st.SortBy select new { so = st.SortBy, id = st.ID }; cbStandort.ItemsSource = sto.ToList(); var kat = from k in Admin.conn.DDC_Haupt orderby k.DDC select new { kat = k.DDC_Name, id = k.ID }; cbKategorie.ItemsSource = kat.ToList(); var serie = from s in Admin.conn.Serien orderby s.SortBy select new { serie = s.SortBy, id = s.ID }; cbSerie.ItemsSource = serie.ToList(); db = DNBDataHandling.GetDataDNB(dnbID); ShowPerson(); FindPublisher(db.dnb_verlagsname); FindLanguage(db.dnb_sprache); FindOrigLanguage(db.dnb_sprache_org); imgLoad(); LoadNewData(); }
private void LoadBookFromDNB(string dNBSuchString) { if (string.IsNullOrEmpty(dNBSuchString) == false) { if (dNBSuchString == "#") { MessageBox.Show("DNB-Suche wurde abgebrochen!"); keineDNBSuche = true; return; } cDNBBook = DNBDataHandling.GetDataDNB(dNBSuchString); } else { //MessageBox.Show("Kein Datensatz in der DNB vorhanden!" + "\r\n" + "Bitte gültige ISBN in der DNB suchen!"); SearchDNB f = new SearchDNB(false, cBook.Titel); f.ShowDialog(); LoadBookFromDNB(f.dnbID); } }