Matrix.TransformPoints メソッド

定義

この Matrix が表すジオメトリック変換を、点の配列に適用します。

オーバーロード

TransformPoints(Point[])

この Matrix が表すジオメトリック変換を、指定した点の配列に適用します。

TransformPoints(PointF[])

この Matrix が表すジオメトリック変換を、指定した点の配列に適用します。

TransformPoints(Point[])

ソース:
Matrix.cs
ソース:
Matrix.cs
ソース:
Matrix.cs

この Matrix が表すジオメトリック変換を、指定した点の配列に適用します。

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

パラメーター

pts
Point[]

変換する複数の点を表す Point 構造体の配列。

次のコード例は、Windows フォームで使用するように設計されており、イベント オブジェクトがPaint必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • 四角形を形成するポイントの配列を作成します。

  • スケーリング変換 (青い四角形) を適用する前に、このポイントの配列を画面に描画します。

  • 行列を作成し、x 軸に 3、y 軸に 2 ずつスケーリングします。

  • この行列変換をポイントの配列に適用します。

  • 変換された配列を画面 (赤い四角形) に描画します。

赤い四角形は、四角形の左上隅 (四角形の始点) を含め、x 軸では 3、y 軸では 2 の係数でスケーリングされていることに注意してください。

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

適用対象

TransformPoints(PointF[])

ソース:
Matrix.cs
ソース:
Matrix.cs
ソース:
Matrix.cs

この Matrix が表すジオメトリック変換を、指定した点の配列に適用します。

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

パラメーター

pts
PointF[]

変換する複数の点を表す PointF 構造体の配列。

例については、「TransformPoints(Point[])」を参照してください。

適用対象