作者wvsrugby (wvsrugby)
看板C_Sharp
标题Re: [问题] 关於CreatGraphics
时间Fri Mar 26 18:52:58 2010
...
List<Point> _points;
public FormPainter()
{
InitializeComponent();
_points = new List<Point>();
this.MouseDown += delegate(object sender, MouseEventArgs e)
{
_points.Add(new Point(e.X, e.Y));
this.Invalidate();
};
this.Paint += delegate(object sender, PaintEventArgs e)
{
if (_points.Count < 2)
return;
e.Graphics.DrawLines(Pens.Red, _points.ToArray());
};
}
...
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.146.41.164
1F:推 andy910389:thanks~ 03/26 20:31
※ 编辑: wvsrugby 来自: 218.161.100.242 (03/26 23:39)