BiliRanking.Core.Fubang.createRoundRect C# (CSharp) Метод

createRoundRect() публичный статический Метод

public static createRoundRect ( int x, int y, int width, int height, int radius ) : GraphicsPath
x int
y int
width int
height int
radius int
Результат System.Drawing.Drawing2D.GraphicsPath
        public static GraphicsPath createRoundRect(int x, int y, int width, int height, int radius)
        {
            GraphicsPath gp = new GraphicsPath();

            if (radius == 0)
                gp.AddRectangle(new Rectangle(x, y, width, height));
            else
            {
                radius *= 2;
                gp.AddLine(x + radius, y, x + width - radius, y);
                gp.AddArc(x + width - radius, y, radius, radius, 270, 90);
                gp.AddLine(x + width, y + radius, x + width, y + height - radius);
                gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90);
                gp.AddLine(x + width - radius, y + height, x + radius, y + height);
                gp.AddArc(x, y + height - radius, radius, radius, 90, 90);
                gp.AddLine(x, y + height - radius, x, y + radius);
                gp.AddArc(x, y, radius, radius, 180, 90);
                gp.CloseFigure();
            }
            return gp;
        }