public void UpdateImage() { if (MyPreviewImageSource != null) { MyPreviewImage = (MagickImage)MyPreviewImageSource.Clone(); ConvertImage(MyPreviewImage); using (MagickImage newImage = (MagickImage)MyPreviewImage.Clone()) { if (newImage.Width < 200 || newImage.Height < 200) { newImage.Scale(200, 200); } PreviewImage.Source = BitmapHelper.ToBitmapSource(newImage); newImage.Dispose(); } ImageSizeLbl.Content = "Size: " + MyPreviewImage.Width + "x" + MyPreviewImage.Height; } }
private void RotateImageBtn_Click(object sender, RoutedEventArgs e) { MyPreviewImageSource?.Rotate(90); UpdateImage(); }