Re: [問題] 關於CreatGraphics

看板C_Sharp作者 (wvsrugby)時間16年前 (2010/03/26 18:53), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
... 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

03/26 20:31, , 1F
thanks~
03/26 20:31, 1F
※ 編輯: wvsrugby 來自: 218.161.100.242 (03/26 23:39)
文章代碼(AID): #1Bh98E8F (C_Sharp)
文章代碼(AID): #1Bh98E8F (C_Sharp)