绘图,画矩形,长方形
// 创建GDI
Graphics g = this.panel1.CreateGraphics();
//创建两个点
Point n1 = new Point(20, 20);
Point n2 = new Point(100, 100);
//创建画笔
Pen p = new Pen(Brushes.Black, 2);
p.EndCap = LineCap.ArrowAnchor;//定义线尾的样式为箭头
g.DrawLine(p, n1, n2);


评论