图形开发基础(2)

图形开发基础(2)

操作实例:

     使用画笔和画刷:

      

Pen myPen=new Pen(Color.Black);
Graphics g=this.CreateGraphics();
g.DrawRectangle(myPen,30,30,70,50);

绘制直线:

Graphics g=this.CreateGraphics();
Pen myPen=new Pen(Color.Red);
g.DrawLine(myPen,130,30,70,50);