Example #1
0
        public static RasterImage Tranform(this RasterImage originalImage, Transform transformProperties)
        {
            var image = originalImage.Clone();

            Transform(transformProperties, image);

            return(image);
        }
Example #2
0
        private static void Transform(Transform transformProperties, RasterImage result)
        {
            var cropCommand   = new CropCommand();
            var rotateCommand = new RotateCommand {
                Angle = (int)(transformProperties.Rotation * 100)
            };

            var rectCrop = new LeadRect(
                (int)transformProperties.Bounds.Left,
                (int)transformProperties.Bounds.Top,
                (int)transformProperties.Bounds.Width,
                (int)transformProperties.Bounds.Height);

            cropCommand.Rectangle = rectCrop;

            rotateCommand.Run(result);
            if (!transformProperties.Bounds.IsEmpty)
            {
                cropCommand.Run(result);
            }
        }
Example #3
0
        private static void Transform(Transform transformProperties, RasterImage result)
        {
            var cropCommand = new CropCommand();
            var rotateCommand = new RotateCommand { Angle = (int)(transformProperties.Rotation * 100) };

            var rectCrop = new LeadRect(
                (int)transformProperties.Bounds.Left,
                (int)transformProperties.Bounds.Top,
                (int)transformProperties.Bounds.Width,
                (int)transformProperties.Bounds.Height);

            cropCommand.Rectangle = rectCrop;

            rotateCommand.Run(result);
            if (!transformProperties.Bounds.IsEmpty)
            {
                cropCommand.Run(result);
            }
        }
Example #4
0
        public static RasterImage Tranform(this RasterImage originalImage, Transform transformProperties)
        {
            var image = originalImage.Clone();

            Transform(transformProperties, image);

            return image;
        }