ITPub博客

首页 > Linux操作系统 > Linux操作系统 > C# 图形化编程 System.Drawing

C# 图形化编程 System.Drawing

原创 Linux操作系统 作者:jyang57 时间:2010-05-22 15:30:29 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/23155850/viewspace-666104/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-01-09

  • 博文量
    110
  • 访问量
    164150