System.Drawing.Drawing2D.Matrix.Multiply C# (CSharp) Method

Multiply() public method

public Multiply ( Matrix matrix ) : void
matrix Matrix
return void
        public void Multiply(Matrix matrix)
        {
            if (matrix == null)
                throw new ArgumentNullException ("matrix");
            Multiply(matrix, MatrixOrder.Prepend);
        }

Same methods

Matrix::Multiply ( Matrix matrix, MatrixOrder order ) : void

Usage Example

Ejemplo n.º 1
0
        static public void TransformPoints(PointF[] points, PointF origin, bool diagonal, bool horizontal, bool vertical)
        {
            Matrix translate = new Matrix();
            Matrix rotate = new Matrix();

            // Put the points into origin/local space
            translate.Translate(-origin.X, -origin.Y);
            translate.TransformPoints(points);

            // Apply the flips/rotations (order matters)
            if (horizontal)
            {
                Matrix h = new Matrix(-1, 0, 0, 1, 0, 0);
                rotate.Multiply(h);
            }
            if (vertical)
            {
                Matrix v = new Matrix(1, 0, 0, -1, 0, 0);
                rotate.Multiply(v);
            }
            if (diagonal)
            {
                Matrix d = new Matrix(0, 1, 1, 0, 0, 0);
                rotate.Multiply(d);
            }

            // Apply the combined flip/rotate transformation
            rotate.TransformPoints(points);

            // Put points back into world space
            translate.Invert();
            translate.TransformPoints(points);
        }
All Usage Examples Of System.Drawing.Drawing2D.Matrix::Multiply