C# 图形化编程 System.Drawing

System.Drawing.Graphics   //画布

System.Drawing.Drawing2D.GraphicsPath   //画图路径,也就是在图上显示的线

System.Drawing.Drawing2D.Matrix  //图像缩放对象

我们再来看看几个重要方法:

//g为Graphics对象 path为GraphicsPath对象

path.AddLine(Point1, Point2);  //在两点间添加一条直线

path.AddArc(x,y,width,height,startAngle,sweepAngle); //添加弧线

path.AddPie(x,y,width,height,startAngle,sweepAngle); //添加扇形 

g.DrawPath(new Pen(Color.Gray, 1), path); //将路径画到画布

g.FillEllipse(brush,x,y,width,height); //在画布上画一个椭圆

g.DrawLine(pen,point1,point2); //在画布上画一条直线

path.Transform(matrix);  //将图像按比例缩放

g.TranslateTransform(x, y, MatrixOrder.Prepend); //平移画布

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23155850/viewspace-666104/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23155850/viewspace-666104/

你可能感兴趣的:(C# 图形化编程 System.Drawing)