Click here to Skip to main content
15,884,739 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
plz can any one suggest me 'how to achieve pinking shears effect in c#'..
thanks in advance.
Posted
Comments
BillWoodruff 25-Sep-13 9:25am    
Are you asking: how do you create a Form or Control with "pinked" edges; or, are you asking how do you take a bitmap, and transform it into having "pinked" edges by introducing transparency to create the "cut-outs" ? What is your goal here ?
umesh_vn 27-Sep-13 11:38am    
Sorry for unclear question. I have to give pinking effect to three edges(left-top-right) of bitmap. And even struggling for folded effect to bottom edge.

1 solution

Thanks to all...
i found solution for this problem. hope it will help someone..

C#
public static void GetPinkingEffect()
        {
           //here depth will decide curve depth
            int depth = 5;
            Bitmap bmp = new Bitmap(@"C:\Users\Public\Pictures\Sample Pictures\Hydrangeas.jpg");

            var CurvePoints = new List<Point>();

            using (var g = Graphics.FromImage(bmp))
            {
                //Only Upper edge considered for Pinking effect..
                CurvePoints.Add(new Point(0, 0));
                for (var i = 0; i < Math.Ceiling((Decimal)bmp.Width / (depth * 2)); i++)
                {
                    CurvePoints.Add(new Point(5 + i * 10, depth));
                    CurvePoints.Add(new Point((i + 1) * 10, 0));
                }
                g.FillPolygon(new SolidBrush(Color.White), CurvePoints.ToArray());
            }
            bmp.Save(@"C:\Users\Public\Pictures\Sample Pictures\Pinking_Hydrangeas.jpg");
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900