none
怎样画出多边形 RRS feed

答案

  • 你好!

         可以参考这个实例:

    public void DrawPolygonPoint(PaintEventArgs e)
    {
           
      // Create pen.
      Pen blackPen = new Pen(Color.Black, 3);
           
      // Create points that define polygon.
      Point point1 = new Point(50, 50);
      Point point2 = new Point(100, 25);
      Point point3 = new Point(200,  5);
      Point point4 = new Point(250, 50);
      Point point5 = new Point(300, 100);
      Point point6 = new Point(350, 200);
      Point point7 = new Point(250, 250);
      Point[] curvePoints =
           {
             point1,
             point2,
             point3,
             point4,
             point5,
             point6,
             point7
           };
           
      // Draw polygon to screen.
      e.Graphics.DrawPolygon(blackPen, curvePoints);
    }


    周雪峰
    2010年5月21日 1:50
    版主

全部回复

  • 你指的人性化的多边形是什么概念?

    是画的多边形的边要不够直?

    2010年5月21日 1:09
  • 你好!

         可以参考这个实例:

    public void DrawPolygonPoint(PaintEventArgs e)
    {
           
      // Create pen.
      Pen blackPen = new Pen(Color.Black, 3);
           
      // Create points that define polygon.
      Point point1 = new Point(50, 50);
      Point point2 = new Point(100, 25);
      Point point3 = new Point(200,  5);
      Point point4 = new Point(250, 50);
      Point point5 = new Point(300, 100);
      Point point6 = new Point(350, 200);
      Point point7 = new Point(250, 250);
      Point[] curvePoints =
           {
             point1,
             point2,
             point3,
             point4,
             point5,
             point6,
             point7
           };
           
      // Draw polygon to screen.
      e.Graphics.DrawPolygon(blackPen, curvePoints);
    }


    周雪峰
    2010年5月21日 1:50
    版主