//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Set the graphics matrix. * @param Value the graphics matrix. */ internal void SetGraphicsMatrix(MatrixFP value) { _graphicsMatrix = new MatrixFP(value); _graphicsMatrix.Invert(); _finalMatrix = new MatrixFP(_graphicsMatrix); if (_matrix != null) { _finalMatrix.Multiply(_matrix); } }
public void Multiply(MatrixX m, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m1 = new MatrixFP(m.matrix); m1.Multiply(matrix); matrix = m1; } else { matrix.Multiply(m.matrix); } }
public void Translate(float offsetX, float offsetY, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m = MatrixFP.Identity(); m.Translate(SingleFP.FromFloat(offsetX), SingleFP.FromFloat(offsetY)); m.Multiply(matrix); matrix = m; } else { matrix.Translate(SingleFP.FromFloat(offsetX), SingleFP.FromFloat(offsetY)); } }
public void Shear(float shearX, float shearY, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m = MatrixFP.Identity(); m.RotateSkew(SingleFP.FromFloat(shearX), SingleFP.FromFloat(shearY)); m.Multiply(matrix); matrix = m; } else { matrix.RotateSkew(SingleFP.FromFloat(shearX), SingleFP.FromFloat(shearY)); } }
public void Scale(float scaleX, float scaleY, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m = MatrixFP.Identity(); m.Scale(SingleFP.FromFloat(scaleX), SingleFP.FromFloat(scaleY)); m.Multiply(matrix); matrix = m; } else { matrix.Scale(SingleFP.FromFloat(scaleX), SingleFP.FromFloat(scaleY)); } }
public void Rotate(float angle, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m = MatrixFP.Identity(); m.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); m.Multiply(matrix); matrix = m; } else { matrix.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); } }
public void Transform(MatrixFP m1) { MatrixFP m = new MatrixFP(m1); m.Invert(); if (matrix == null) { matrix = m; } else { matrix.Multiply(m); } }
public void RotateAt(float angle, PointF point, MatrixOrderX order) { if (order == MatrixOrderX.Prepend) { MatrixFP m = MatrixFP.Identity(); m.Translate(SingleFP.FromFloat(-point.X), SingleFP.FromFloat(-point.Y)); m.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); m.Multiply(matrix); m.Translate(SingleFP.FromFloat(point.X), SingleFP.FromFloat(point.Y)); matrix = m; } else { matrix.Translate(SingleFP.FromFloat(-point.X), SingleFP.FromFloat(-point.Y)); matrix.Rotate(MathFP.ToRadians(SingleFP.FromFloat(angle))); matrix.Translate(SingleFP.FromFloat(point.X), SingleFP.FromFloat(point.Y)); } }