Aracılığıyla paylaş


Matrix.TransformPoints Yöntem

Tanım

Bunu Matrix temsil eden geometrik dönüşümü bir nokta dizisine uygular.

Aşırı Yüklemeler

TransformPoints(Point[])

Bunun Matrix temsil ettiği geometrik dönüşümü belirtilen nokta dizisine uygular.

TransformPoints(PointF[])

Bunun Matrix temsil ettiği geometrik dönüşümü belirtilen nokta dizisine uygular.

TransformPoints(Point[])

Kaynak:
Matrix.cs
Kaynak:
Matrix.cs
Kaynak:
Matrix.cs

Bunun Matrix temsil ettiği geometrik dönüşümü belirtilen nokta dizisine uygular.

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())

Parametreler

pts
Point[]

Dönüştürülecek noktaları temsil eden bir yapı dizisi Point .

Örnekler

Aşağıdaki kod örneği, Windows Forms ile kullanılmak üzere tasarlanmıştır ve bir Paint olay nesnesi gerektirir.PaintEventArgse Kod aşağıdaki eylemleri gerçekleştirir:

  • Dikdörtgen oluşturan bir nokta dizisi oluşturur.

  • Bu nokta dizisini çizer (ölçeklendirme dönüştürmesi uygulamadan önce ekrana (mavi dikdörtgen).

  • Bir matris oluşturur ve bunu x ekseninde 3, y ekseninde 2 ölçeklendirir.

  • Bu matris dönüşümünü nokta dizisine uygular.

  • Dönüştürülmüş diziyi ekrana (kırmızı dikdörtgen) çizer.

Kırmızı dikdörtgenin x ekseninde 3, y ekseninde ise 2 kat ölçeklendirildiğini ve dikdörtgenin sol üst köşesini (dikdörtgenin başlangıç noktasını) dikkat edin.

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

Şunlara uygulanır

TransformPoints(PointF[])

Kaynak:
Matrix.cs
Kaynak:
Matrix.cs
Kaynak:
Matrix.cs

Bunun Matrix temsil ettiği geometrik dönüşümü belirtilen nokta dizisine uygular.

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())

Parametreler

pts
PointF[]

Dönüştürülecek noktaları temsil eden bir yapı dizisi PointF .

Örnekler

Örnek için bkz. TransformPoints(Point[])

Şunlara uygulanır