孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

可以用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 }
posted on 2011-05-07 20:40  孤独的猫  阅读(10203)  评论(1编辑  收藏  举报