|
画笔功能
- //PictureBox pb = (PictureBox)Control.FromHandle(xx);
- Graphics g = pictureBox1.CreateGraphics();
- Pen pp = new Pen(Color.Green, 2);
- g.DrawLine(pp, new Point(0, 0), new Point(100, 100));
- // 一定释放!否则容易内存泄露
- g.Dispose();
复制代码 方法二:- Graphics g = pictureBox1.CreateGraphics();
- g.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100));
- // 一定释放!否则容易内存泄露
- g.Dispose();
复制代码
|
|