コード例 #1
0
        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;
            }
        }
コード例 #2
0
 private void RotateImageBtn_Click(object sender, RoutedEventArgs e)
 {
     MyPreviewImageSource?.Rotate(90);
     UpdateImage();
 }