Matrix.TransformPoints 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將此 Matrix 幾何變換套用於一組點陣列。
多載
| 名稱 | Description |
|---|---|
| TransformPoints(ReadOnlySpan<PointF>) |
將此 Matrix 幾何變換應用於指定的點陣列。 |
| TransformPoints(ReadOnlySpan<Point>) |
將此 Matrix 幾何變換應用於指定的點陣列。 |
| TransformPoints(PointF[]) |
將此 Matrix 幾何變換應用於指定的點陣列。 |
| TransformPoints(Point[]) |
將此 Matrix 幾何變換應用於指定的點陣列。 |
TransformPoints(ReadOnlySpan<PointF>)
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
將此 Matrix 幾何變換應用於指定的點陣列。
public:
void TransformPoints(ReadOnlySpan<System::Drawing::PointF> pts);
public void TransformPoints(scoped ReadOnlySpan<System.Drawing.PointF> pts);
member this.TransformPoints : ReadOnlySpan<System.Drawing.PointF> -> unit
Public Sub TransformPoints (pts As ReadOnlySpan(Of PointF))
參數
- pts
- ReadOnlySpan<PointF>
一個代表要轉換點的結構陣列 Point 。
適用於
TransformPoints(ReadOnlySpan<Point>)
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
將此 Matrix 幾何變換應用於指定的點陣列。
public:
void TransformPoints(ReadOnlySpan<System::Drawing::Point> pts);
public void TransformPoints(scoped ReadOnlySpan<System.Drawing.Point> pts);
member this.TransformPoints : ReadOnlySpan<System.Drawing.Point> -> unit
Public Sub TransformPoints (pts As ReadOnlySpan(Of Point))
參數
- pts
- ReadOnlySpan<Point>
一個代表要轉換點的結構陣列 Point 。
適用於
TransformPoints(PointF[])
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
將此 Matrix 幾何變換應用於指定的點陣列。
public:
void TransformPoints(... cli::array <System::Drawing::PointF> ^ pts);
public:
void TransformPoints(cli::array <System::Drawing::PointF> ^ pts);
public void TransformPoints(params System.Drawing.PointF[] pts);
public void TransformPoints(System.Drawing.PointF[] pts);
member this.TransformPoints : System.Drawing.PointF[] -> unit
Public Sub TransformPoints (ParamArray pts As PointF())
Public Sub TransformPoints (pts As PointF())
參數
範例
如需範例,請參閱 TransformPoints(Point[])。
適用於
TransformPoints(Point[])
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
- 來源:
- Matrix.cs
將此 Matrix 幾何變換應用於指定的點陣列。
public:
void TransformPoints(... cli::array <System::Drawing::Point> ^ pts);
public:
void TransformPoints(cli::array <System::Drawing::Point> ^ pts);
public void TransformPoints(params System.Drawing.Point[] pts);
public void TransformPoints(System.Drawing.Point[] pts);
member this.TransformPoints : System.Drawing.Point[] -> unit
Public Sub TransformPoints (ParamArray pts As Point())
Public Sub TransformPoints (pts As Point())
參數
範例
以下程式碼範例是為 Windows Forms 設計,並需要 PaintEventArgse,一個 Paint 事件物件。 此程式碼會執行下列動作:
建立一個點陣列,形成一個矩形。
在施加縮放轉換(藍色矩形)之前,會將這個點陣列畫到螢幕上。
建立一個矩陣,並在 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