private void SaveC(object obj) { BitmapSource save = ImageConverterFormat.ConvertToBitmapSource(this.Collage); Bitmap collageImage = (Bitmap)ImageConverterFormat.GetBitmapFromSource(save).Clone(); ImageFunction.SaveAsCurrentImage(collageImage); }
/// <summary> /// Left button click events /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ImageOp_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.ButtonState == MouseButtonState.Pressed && VisibilityProperties.Instance.InsertTextVisibility == true && VisibilityProperties.Instance.TextButtonChecked == true && check == 2 && TextBoxInsertText.Text != null) { if (ImageOp.IsMouseOver == true) { TextBoxInsertText.IsEnabled = false; } Images.Instance.CurrentBitmap = ImageConverterFormat.GetBitmapFromSource(ImageConverterFormat.ConvertToBitmapSource(ImageGrid)); Images.Instance.NotifyImages(); TextBoxInsertText.Text = null; VisibilityProperties.Instance.InsertTextVisibility = false; VisibilityProperties.Instance.NotifyProperties(); if (VisibilityProperties.Instance.TextButtonChecked == true) { VisibilityProperties.Instance.HomePanelIsSelected = true; VisibilityProperties.Instance.NotifyProperties(); } } else { check = 1; } }
private void OpenInEditorC(object obj) { BitmapSource save = ImageConverterFormat.ConvertToBitmapSource(this.Collage); Bitmap collageImage = (Bitmap)ImageConverterFormat.GetBitmapFromSource(save).Clone(); Bitmap clone = new Bitmap(collageImage.Width, collageImage.Height, Models.Images.Instance.CurrentBitmap.PixelFormat); using (Graphics gr = Graphics.FromImage(clone)) { gr.DrawImage(collageImage, new Rectangle(0, 0, clone.Width, clone.Height)); } Models.Images.Instance.CurrentBitmap = (Bitmap)clone.Clone(); Models.Images.Instance.UndoBr = 0; Models.UndoRedoModel.Instance.RedoStack = new Stack <Bitmap>(); Models.UndoRedoModel.Instance.UndoStack = new Stack <Bitmap>(); Models.Images.Instance.NotifyImages(); }