private void SelectButton_Click(object sender, RoutedEventArgs e) { DWindow_Image imgsel = new DWindow_Image(data); imgsel.Owner = Window.GetWindow(this); imgsel.ShowDialog(); if (imgsel.SelectedImage) { brush = new ImageBrush(data.archive.GetImage(imgsel.SelectedKey)); ((ImageBrush)brush).Stretch = (Stretch)ComboBox_Stretch.SelectedIndex; R_ImageFill.Fill = ((ImageBrush)brush); ((ImageBrush)R_ImageFill.Fill).Stretch = Stretch.UniformToFill; LastSelectedImageKey = imgsel.SelectedKey; if (SetTag) { if (!foreground) { cont.Tag = new DesignSave(new ImageRepresentation(imgsel.SelectedKey, (Stretch)ComboBox_Stretch.SelectedIndex)).Serialize(); } else { cont.Tag = new DesignSave(null, new ImageRepresentation(imgsel.SelectedKey, (Stretch)ComboBox_Stretch.SelectedIndex)).Serialize(); } } if (ChangedBrush != null) { ChangedBrush(this, brush); } } }
private void SelectButton_Click(object sender, RoutedEventArgs e) { DWindow_Image imgsel = new DWindow_Image(data); imgsel.Owner = Window.GetWindow(this); imgsel.ShowDialog(); if (imgsel.SelectedImage) { cont.Source = data.archive.GetImage(imgsel.SelectedKey); cont.Stretch = (Stretch)ComboBox_Stretch.SelectedIndex; R_ImageFill.Fill = new ImageBrush(cont.Source); ((ImageBrush)R_ImageFill.Fill).Stretch = Stretch.UniformToFill; Debug.WriteLine("" + imgsel.SelectedKey); cont.Tag = new DesignSave(new ImageRepresentation(imgsel.SelectedKey, (Stretch)ComboBox_Stretch.SelectedIndex)).Serialize(); } }
private void SelectButton_Click(object sender, RoutedEventArgs e) { DWindow_Image imgsel = new DWindow_Image(data); imgsel.Owner = Window.GetWindow(this); imgsel.ShowDialog(); if (imgsel.SelectedImage) { if (data.pages.Count > 0) { cont.Background = new ImageBrush(data.archive.GetImage(imgsel.SelectedKey)); ((ImageBrush)cont.Background).Stretch = (Stretch)ComboBox_Stretch.SelectedIndex; data.pages[selpos].CustomBrush = true; data.pages[selpos].ImageBrush = new ImageRepresentation(imgsel.SelectedKey, (Stretch)ComboBox_Stretch.SelectedIndex); data.pages[selpos].IsImageBrush = true; R_ImageFill.Fill = ((ImageBrush)cont.Background); ((ImageBrush)R_ImageFill.Fill).Stretch = Stretch.UniformToFill; } } }
private void SelectButton_Click(object sender, RoutedEventArgs e) { DWindow_Image imgsel = new DWindow_Image(data); imgsel.Owner = Window.GetWindow(this); imgsel.ShowDialog(); if (imgsel.SelectedImage) { cont.Content = new Image() { Source = data.archive.GetImage(imgsel.SelectedKey) }; //cont.Stretch = (Stretch)ComboBox_Stretch.SelectedIndex; R_ImageFill.Fill = new ImageBrush(((Image)cont.Content).Source); ((ImageBrush)R_ImageFill.Fill).Stretch = Stretch.UniformToFill; ((Content_Image)cont.Tag).ImageKey = imgsel.SelectedKey; Debug.WriteLine("" + imgsel.SelectedKey); } }
private void SelectButton_Click(object sender, RoutedEventArgs e) { DWindow_Image imgsel = new DWindow_Image(data); imgsel.Owner = Window.GetWindow(this); imgsel.ShowDialog(); if (imgsel.SelectedImage) { cont.M_Img.Source = data.archive.GetImage(imgsel.SelectedKey); cont.M_Img.Stretch = Stretch.Uniform; R_ImageFill.Fill = new ImageBrush(cont.M_Img.Source); ((ImageBrush)R_ImageFill.Fill).Stretch = Stretch.UniformToFill; Debug.WriteLine("" + imgsel.SelectedKey); cont.ImageKey = imgsel.SelectedKey; data.archive.GetImageSize(imgsel.SelectedKey, out cont.DefaultW, out cont.DefaultH); cont.M_Img.Width = cont.DefaultW; cont.M_Img.Height = cont.DefaultH; } }