Example #1
0
File: Skew.cs Project: ywscr/ShareX
        public override Bitmap Apply(Bitmap bmp)
        {
            if (Horizontally == 0 && Vertically == 0)
            {
                return(bmp);
            }

            return(ImageHelpers.AddSkew(bmp, Horizontally, Vertically));
        }
Example #2
0
        public override Image Apply(Image img)
        {
            if (Horizontally == 0 && Vertically == 0)
            {
                return(img);
            }

            return(ImageHelpers.AddSkew(img, Horizontally, Vertically));
        }
Example #3
0
        public static Image DrawReflection(Image img, int percentage, int maxAlpha, int minAlpha, int offset, bool skew, int skewSize)
        {
            Bitmap reflection = ImageHelpers.AddReflection(img, percentage, maxAlpha, minAlpha);

            if (skew)
            {
                reflection = ImageHelpers.AddSkew(reflection, skewSize, 0);
            }

            Bitmap result = new Bitmap(reflection.Width, img.Height + reflection.Height + offset);

            using (Graphics g = Graphics.FromImage(result))
                using (img)
                    using (reflection)
                    {
                        g.SetHighQuality();
                        g.DrawImage(img, 0, 0, img.Width, img.Height);
                        g.DrawImage(reflection, 0, img.Height + offset, reflection.Width, reflection.Height);
                    }

            return(result);
        }