在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
C#中画三角形和填充三角形的简单实现: private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; //绘制三角形 DrawTriangle_1(g); //填充三角形 FillTriangle_1(g); } // 绘制三角形 private void DrawTriangle_1(Graphics g) { Point point1 = new Point(50, 20); Point point2 = new Point(75, 50); Point point3 = new Point(100, 20); Point[] pntArr = { point1, point2, point3 }; g.DrawPolygon(new Pen(Color.Red), pntArr); } // 填充三角形 private void FillTriangle_1(Graphics g) { Point point1 = new Point(50, 20); Point point2 = new Point(75, 50); Point point3 = new Point(100, 20); Point[] pntArr = { point1, point2, point3 }; g.FillPolygon(Brushes.Red, pntArr); } |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论