用2d绘图创建一个足球c#

时间:2013-05-21 15:36:36

标签: c# polygon

我已经尝试过在球和球的内部制作这个但我不知道如何用我创建的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);
}

0 个答案:

没有答案