4、redraw the path via Invalidate()
数学家们将其统一为一个3*3矩阵,存储形式如下:
由于表示仿射变换的矩阵的第三列总是(0,0,1),在存储矩阵的时候,大多只存成一个2*3的数组。
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); //平移画布
新闻热点
疑难解答