Matrix.TransformPoints Método

Definición

Aplica la transformación geométrica que representa esta Matrix a una matriz de puntos.

Sobrecargas

TransformPoints(Point[])

Aplica la transformación geométrica que representa esta Matrix a una matriz de puntos especificada.

TransformPoints(PointF[])

Aplica la transformación geométrica que representa esta Matrix a una matriz de puntos especificada.

TransformPoints(Point[])

Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs

Aplica la transformación geométrica que representa esta Matrix a una matriz de puntos especificada.

public:
 void TransformPoints(cli::array <System::Drawing::Point> ^ pts);
public void TransformPoints (System.Drawing.Point[] pts);
member this.TransformPoints : System.Drawing.Point[] -> unit
Public Sub TransformPoints (pts As Point())

Parámetros

pts
Point[]

Matriz de estructuras Point que representa los puntos que se van a transformar.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, un Paint objeto de evento. El código realiza las siguientes acciones:

  • Crea una matriz de puntos que forman un rectángulo.

  • Dibuja esta matriz de puntos (en la pantalla antes de aplicar una transformación de escalado (el rectángulo azul).

  • Crea una matriz y la escala en 3 en el eje x y 2 en el eje Y.

  • Aplica esta transformación de matriz a la matriz de puntos.

  • Dibuja la matriz transformada en la pantalla (rectángulo rojo).

Observe que el rectángulo rojo se ha escalado mediante un factor de 3 en el eje x y en 2 en el eje y, incluida la esquina superior izquierda del rectángulo (el punto inicial del rectángulo).

public:
   void TransformPointsExample( PaintEventArgs^ e )
   {
      Pen^ myPen = gcnew Pen( Color::Blue,1.0f );
      Pen^ myPen2 = gcnew Pen( Color::Red,1.0f );

      // Create an array of points.
      array<Point>^ myArray = {Point(20,20),Point(120,20),Point(120,120),Point(20,120),Point(20,20)};

      // Draw the Points to the screen before applying the
      // transform.
      e->Graphics->DrawLines( myPen, myArray );

      // Create a matrix and scale it.
      Matrix^ myMatrix = gcnew Matrix;
      myMatrix->Scale( 3, 2, MatrixOrder::Append );
      myMatrix->TransformPoints( myArray );

      // Draw the Points to the screen again after applying the
      // transform.
      e->Graphics->DrawLines( myPen2, myArray );
   }
public void TransformPointsExample(PaintEventArgs e)
{
    Pen myPen = new Pen(Color.Blue, 1);
    Pen myPen2 = new Pen(Color.Red, 1);
             
    // Create an array of points.
    Point[] myArray =
             {
                 new Point(20, 20),
                 new Point(120, 20),
                 new Point(120, 120),
                 new Point(20, 120),
                 new Point(20,20)
             };
             
    // Draw the Points to the screen before applying the
    // transform.
    e.Graphics.DrawLines(myPen, myArray);
             
    // Create a matrix and scale it.
    Matrix myMatrix = new Matrix();
    myMatrix.Scale(3, 2, MatrixOrder.Append);
    myMatrix.TransformPoints(myArray);
             
    // Draw the Points to the screen again after applying the
    // transform.
    e.Graphics.DrawLines(myPen2, myArray);
}
Public Sub TransformPointsExample(ByVal e As PaintEventArgs)
    Dim myPen As New Pen(Color.Blue, 1)
    Dim myPen2 As New Pen(Color.Red, 1)

    ' Create an array of points.
    Dim myArray As Point() = {New Point(20, 20), New Point(120, 20), _
    New Point(120, 120), New Point(20, 120), New Point(20, 20)}

    ' Draw the Points to the screen before applying the
    ' transform.
    e.Graphics.DrawLines(myPen, myArray)

    ' Create a matrix and scale it.
    Dim myMatrix As New Matrix
    myMatrix.Scale(3, 2, MatrixOrder.Append)
    myMatrix.TransformPoints(myArray)

    ' Draw the Points to the screen again after applying the
    ' transform.
    e.Graphics.DrawLines(myPen2, myArray)
End Sub

Se aplica a

TransformPoints(PointF[])

Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs

Aplica la transformación geométrica que representa esta Matrix a una matriz de puntos especificada.

public:
 void TransformPoints(cli::array <System::Drawing::PointF> ^ pts);
public void TransformPoints (System.Drawing.PointF[] pts);
member this.TransformPoints : System.Drawing.PointF[] -> unit
Public Sub TransformPoints (pts As PointF())

Parámetros

pts
PointF[]

Matriz de estructuras PointF que representa los puntos que se van a transformar.

Ejemplos

Para obtener un ejemplo, consulte TransformPoints(Point[]).

Se aplica a