首页 > 其他 > 详细

绘制多边形

时间:2019-01-11 22:35:24      阅读:161      评论:0      收藏:0      [点我收藏+]

实现效果

  技术分享图片

知识运用:

  Graphics类的DrawPolygon (Pen pen,Point[] points)  //绘制由一组Point结构定义的多边形

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            Graphics graphics = this.CreateGraphics();
            Pen myPen = new Pen(Color.Black,3);
            Point pt1 = new Point(80,150);
            Point pt2 = new Point(120, 20);
            Point pt3 = new Point(240, 20);
            Point pt4 = new Point(280,150);
            Point pt5 = new Point(140,240);
            Point[] myPoints = { pt1,pt2,pt3,pt4,pt5};
            graphics.DrawPolygon(myPen,myPoints);
        }

  

绘制多边形

原文:https://www.cnblogs.com/feiyucha/p/10257654.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!