Ejemplo n.º 1
0
        void DoMagic(ImageEditMode mode, IMagickImage image, int originalWidth, int originalHeight)
        {
            switch (mode)
            {
            case ImageEditMode.Swirl:
                image.Swirl(360);
                break;

            case ImageEditMode.Rescale:
                image.LiquidRescale(image.Width / 2, image.Height / 2);
                image.LiquidRescale((image.Width * 3) / 2, (image.Height * 3) / 2);
                image.Resize(originalWidth, originalHeight);
                break;

            case ImageEditMode.Wave:
                image.BackgroundColor = MagickColor.FromRgb(0, 0, 0);
                image.Wave(image.Interpolate, 10.0, 150.0);
                break;

            case ImageEditMode.Implode:
                image.Implode(0.5d, PixelInterpolateMethod.Average);
                break;

            case ImageEditMode.JPEG:
                image.Quality = 10;
                break;

            case ImageEditMode.MoreJPEG:
                image.Quality = 5;
                break;

            case ImageEditMode.MostJPEG:
                image.Quality = 1;
                break;

            default:
                break;
            }
        }