Example #1
0
        // Token: 0x06000352 RID: 850 RVA: 0x000158DC File Offset: 0x00013ADC
        public override void Apply(ref ScrapBase scrap, Point clickpoint)
        {
            var flag   = false;
            var image  = scrap.Image;
            var rotate = Rotate;

            if (rotate != 90)
            {
                if (rotate != 180)
                {
                    if (rotate == 270)
                    {
                        image.RotateFlip(RotateFlipType.Rotate270FlipNone);
                        flag = true;
                    }
                }
                else
                {
                    image.RotateFlip(RotateFlipType.Rotate180FlipNone);
                }
            }
            else
            {
                image.RotateFlip(RotateFlipType.Rotate90FlipNone);
                flag = true;
            }
            if (VerticalReflection)
            {
                image.RotateFlip(RotateFlipType.Rotate180FlipX);
            }
            if (HorizonReflection)
            {
                image.RotateFlip(RotateFlipType.RotateNoneFlipX);
            }
            if (flag)
            {
                var width  = scrap.ClientSize.Width;
                var height = scrap.ClientSize.Height;
                var left   = scrap.Location.X + (width - height) / 2;
                var top    = scrap.Location.Y + (height - width) / 2;
                scrap.SuspendLayout();
                scrap.ClientSize = new Size(height, width);
                scrap.Left       = left;
                scrap.Top        = top;
                scrap.ResumeLayout();
            }
            scrap.Refresh();
        }
Example #2
0
        public override void Apply(ref ScrapBase scrap, Point clickpoint)
        {
            bool  flag  = false;
            Image image = scrap.Image;

            switch (this.Rotate)
            {
            case 90:
                image.RotateFlip(RotateFlipType.Rotate90FlipNone);
                flag = true;
                break;

            case 180:
                image.RotateFlip(RotateFlipType.Rotate180FlipNone);
                break;

            case 270:
                image.RotateFlip(RotateFlipType.Rotate270FlipNone);
                flag = true;
                break;
            }
            if (this.VerticalReflection)
            {
                image.RotateFlip(RotateFlipType.Rotate180FlipX);
            }
            if (this.HorizonReflection)
            {
                image.RotateFlip(RotateFlipType.RotateNoneFlipX);
            }
            if (flag)
            {
                int width  = scrap.ClientSize.Width;
                int height = scrap.ClientSize.Height;
                int num3   = scrap.Location.X + ((width - height) / 2);
                int num4   = scrap.Location.Y + ((height - width) / 2);
                scrap.SuspendLayout();
                scrap.ClientSize = new Size(height, width);
                scrap.Left       = num3;
                scrap.Top        = num4;
                scrap.ResumeLayout();
            }
            scrap.Refresh();
        }