FastColoredTextBoxNS.Style.GetRoundedRectangle C# (CSharp) Method

GetRoundedRectangle() public static method

public static GetRoundedRectangle ( Rectangle rect, int d ) : GraphicsPath
rect System.Drawing.Rectangle
d int
return System.Drawing.Drawing2D.GraphicsPath
        public static GraphicsPath GetRoundedRectangle(Rectangle rect, int d)
        {
            GraphicsPath gp = new GraphicsPath();

            gp.AddArc(rect.X, rect.Y, d, d, 180, 90);
            gp.AddArc(rect.X + rect.Width - d, rect.Y, d, d, 270, 90);
            gp.AddArc(rect.X + rect.Width - d, rect.Y + rect.Height - d, d, d, 0, 90);
            gp.AddArc(rect.X, rect.Y + rect.Height - d, d, d, 90, 90);
            gp.AddLine(rect.X, rect.Y + rect.Height - d, rect.X, rect.Y + d / 2);

            return gp;
        }