看板 C_Sharp 關於我們 聯絡資訊
... 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
andy910389:thanks~ 03/26 20:31
※ 編輯: wvsrugby 來自: 218.161.100.242 (03/26 23:39)