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

TransformPoints() private method

private TransformPoints ( List pts ) : void
pts List
return void
        internal void TransformPoints(List<PointF> pts)
        {
            if (pts == null)
                throw new ArgumentNullException ("pts");

            for (int i = 0; i < pts.Count; i++)
                pts [i] = transform.TransformPoint (pts [i].ToCGPoint() ).ToPointF ();
        }

Same methods

Matrix::TransformPoints ( Point pts ) : void
Matrix::TransformPoints ( PointF pts ) : 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::TransformPoints