SoFunction
Updated on 2025-04-03

Analysis of how to draw the border angle of a control into an arc in C#


private void Draw(Graphics graphics, Control control)
        {
            float X = (()) - 1;
            float Y = (()) - 1;
            PointF[] pointfs = {
                new PointF(2,     0),
                new PointF(X-2,   0),
                new PointF(X-1,   1),
                new PointF(X,     2),
                new PointF(X,     Y-2),
                new PointF(X-1,   Y-1),
                new PointF(X-2,   Y),
                new PointF(2,     Y),
                new PointF(1,     Y-1),
                new PointF(0,     Y-2),
                new PointF(0,     2),
                new PointF(1,     1)
                };

            GraphicsPath path = new GraphicsPath();
            (pointfs);

            Pen pen = new Pen((150, ), 1);
            = ;
            (pen, path);
        }