1

我已经尝试在球和球内制作这个,但我不知道如何用我创建的 GraphiPath 填充球

private void soccerball_Paint(object sender, PaintEventArgs e)
{
    Graphics soccerballg = e.Graphics;
    GraphicsPath hexagon = new GraphicsPath();
    Pen pen = new Pen(Color.Red, 2);
    SolidBrush brush = new SolidBrush(Color.Black);
    Point[] points = new Point[]{
        new Point(100,100),
        new Point(108,100),
        new Point(114,106),
        new Point(108,112),
        new Point(100,112),
        new Point(94,106)
    };
    hexagon.AddPolygon(points);
    Rectangle rect = new Rectangle(100, 100, 250, 250);
    hexagon.AddEllipse(rect);

    soccerballg.DrawPath(pen, hexagon);        
    soccerballg.FillRectangle(interior, rect);
}
4

0 回答 0