Matrix.Transform 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定的點、點陣列、向量或向量陣列轉換為此變 Matrix換。
多載
| 名稱 | Description |
|---|---|
| Transform(Point) |
將指定點 變換為 並 Matrix 返回結果。 |
| Transform(Point[]) |
將指定點轉換為此 Matrix。 |
| Transform(Vector) |
將指定的向量轉換為此 Matrix。 |
| Transform(Vector[]) |
將指定向量轉換為此 Matrix。 |
範例
以下範例展示了如何使用 來 Matrix 轉換點和向量。
private void transformExamples()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
//
// Transform a point.
//
Point myPoint = new Point(15,25);
// pointResult is (475, 680).
Point pointResult = myMatrix.Transform(myPoint);
//
// Transform an array of points.
//
Point[] myPointArray = new Point[]
{new Point(15,25), new Point(30,35)};
// myPointArray[0] becomes (475, 680).
// myPointArray[1] becomes (700, 1030).
myMatrix.Transform(myPointArray);
//
// Transform a vector.
//
Vector myVector = new Vector(15,25);
// vectorResult becomes (450, 650).
Vector vectorResult = myMatrix.Transform(myVector);
//
// Transform an array of vectors.
//
Vector[] myVectorArray = new Vector[]
{new Vector(15, 25), new Vector(30,35)};
// myVectorArray[0] becomes (450, 650).
// myVectorArray[1] becomes (675, 1000).
myMatrix.Transform(myVectorArray);
}
Transform(Point)
將指定點 變換為 並 Matrix 返回結果。
public:
System::Windows::Point Transform(System::Windows::Point point);
public System.Windows.Point Transform(System.Windows.Point point);
member this.Transform : System.Windows.Point -> System.Windows.Point
Public Function Transform (point As Point) As Point
參數
- point
- Point
轉化的時刻。
傳回
由 轉換為 pointMatrix的結果。
範例
以下範例展示了如何使用 來 Matrix 轉換點和向量。
private void transformExamples()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
//
// Transform a point.
//
Point myPoint = new Point(15,25);
// pointResult is (475, 680).
Point pointResult = myMatrix.Transform(myPoint);
//
// Transform an array of points.
//
Point[] myPointArray = new Point[]
{new Point(15,25), new Point(30,35)};
// myPointArray[0] becomes (475, 680).
// myPointArray[1] becomes (700, 1030).
myMatrix.Transform(myPointArray);
//
// Transform a vector.
//
Vector myVector = new Vector(15,25);
// vectorResult becomes (450, 650).
Vector vectorResult = myMatrix.Transform(myVector);
//
// Transform an array of vectors.
//
Vector[] myVectorArray = new Vector[]
{new Vector(15, 25), new Vector(30,35)};
// myVectorArray[0] becomes (450, 650).
// myVectorArray[1] becomes (675, 1000).
myMatrix.Transform(myVectorArray);
}
適用於
Transform(Point[])
將指定點轉換為此 Matrix。
public:
void Transform(cli::array <System::Windows::Point> ^ points);
public void Transform(System.Windows.Point[] points);
member this.Transform : System.Windows.Point[] -> unit
Public Sub Transform (points As Point())
參數
- points
- Point[]
要變形的點數。 陣列中的原始點會被其轉換後的值取代。
範例
以下範例展示了如何使用 來 Matrix 轉換點和向量。
private void transformExamples()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
//
// Transform a point.
//
Point myPoint = new Point(15,25);
// pointResult is (475, 680).
Point pointResult = myMatrix.Transform(myPoint);
//
// Transform an array of points.
//
Point[] myPointArray = new Point[]
{new Point(15,25), new Point(30,35)};
// myPointArray[0] becomes (475, 680).
// myPointArray[1] becomes (700, 1030).
myMatrix.Transform(myPointArray);
//
// Transform a vector.
//
Vector myVector = new Vector(15,25);
// vectorResult becomes (450, 650).
Vector vectorResult = myMatrix.Transform(myVector);
//
// Transform an array of vectors.
//
Vector[] myVectorArray = new Vector[]
{new Vector(15, 25), new Vector(30,35)};
// myVectorArray[0] becomes (450, 650).
// myVectorArray[1] becomes (675, 1000).
myMatrix.Transform(myVectorArray);
}
適用於
Transform(Vector)
將指定的向量轉換為此 Matrix。
public:
System::Windows::Vector Transform(System::Windows::Vector vector);
public System.Windows.Vector Transform(System.Windows.Vector vector);
member this.Transform : System.Windows.Vector -> System.Windows.Vector
Public Function Transform (vector As Vector) As Vector
參數
- vector
- Vector
變換向量。
傳回
由 轉換為 vectorMatrix的結果。
範例
以下範例展示了如何使用 來 Matrix 轉換點和向量。
private void transformExamples()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
//
// Transform a point.
//
Point myPoint = new Point(15,25);
// pointResult is (475, 680).
Point pointResult = myMatrix.Transform(myPoint);
//
// Transform an array of points.
//
Point[] myPointArray = new Point[]
{new Point(15,25), new Point(30,35)};
// myPointArray[0] becomes (475, 680).
// myPointArray[1] becomes (700, 1030).
myMatrix.Transform(myPointArray);
//
// Transform a vector.
//
Vector myVector = new Vector(15,25);
// vectorResult becomes (450, 650).
Vector vectorResult = myMatrix.Transform(myVector);
//
// Transform an array of vectors.
//
Vector[] myVectorArray = new Vector[]
{new Vector(15, 25), new Vector(30,35)};
// myVectorArray[0] becomes (450, 650).
// myVectorArray[1] becomes (675, 1000).
myMatrix.Transform(myVectorArray);
}
適用於
Transform(Vector[])
將指定向量轉換為此 Matrix。
public:
void Transform(cli::array <System::Windows::Vector> ^ vectors);
public void Transform(System.Windows.Vector[] vectors);
member this.Transform : System.Windows.Vector[] -> unit
Public Sub Transform (vectors As Vector())
參數
- vectors
- Vector[]
變換向量。 陣列中的原始向量會被其轉換後的值取代。
範例
以下範例展示了如何使用 來 Matrix 轉換點和向量。
private void transformExamples()
{
Matrix myMatrix = new Matrix(5, 10, 15, 20, 25, 30);
//
// Transform a point.
//
Point myPoint = new Point(15,25);
// pointResult is (475, 680).
Point pointResult = myMatrix.Transform(myPoint);
//
// Transform an array of points.
//
Point[] myPointArray = new Point[]
{new Point(15,25), new Point(30,35)};
// myPointArray[0] becomes (475, 680).
// myPointArray[1] becomes (700, 1030).
myMatrix.Transform(myPointArray);
//
// Transform a vector.
//
Vector myVector = new Vector(15,25);
// vectorResult becomes (450, 650).
Vector vectorResult = myMatrix.Transform(myVector);
//
// Transform an array of vectors.
//
Vector[] myVectorArray = new Vector[]
{new Vector(15, 25), new Vector(30,35)};
// myVectorArray[0] becomes (450, 650).
// myVectorArray[1] becomes (675, 1000).
myMatrix.Transform(myVectorArray);
}