可以用Pen(画笔)的StartCap和EndCap定义箭头的起止形状,再用DrawLine画出
1
private
void
Form1_Paint(
object
sender, PaintEventArgs e)
2 {
3 Graphics g = e.Graphics;
4 g.SmoothingMode = SmoothingMode.AntiAlias;
5 g.FillRectangle(Brushes.White, this .ClientRectangle);
6
7 Pen p = new Pen(Color.Black, 10 );
8 p.StartCap = LineCap.Round;
9 p.EndCap = LineCap.ArrowAnchor;
10 g.DrawLine(p, 30 , 30 , 80 , 30 );
11 p.Dispose();
12 }
2 {
3 Graphics g = e.Graphics;
4 g.SmoothingMode = SmoothingMode.AntiAlias;
5 g.FillRectangle(Brushes.White, this .ClientRectangle);
6
7 Pen p = new Pen(Color.Black, 10 );
8 p.StartCap = LineCap.Round;
9 p.EndCap = LineCap.ArrowAnchor;
10 g.DrawLine(p, 30 , 30 , 80 , 30 );
11 p.Dispose();
12 }