Matrix.Scale メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
スケール ベクターを前に付加することで、指定したスケール ベクターをこの Matrix に適用します。
オーバーロード
Scale(Single, Single) |
スケール ベクターを前に付加することで、指定したスケール ベクターをこの Matrix に適用します。 |
Scale(Single, Single, MatrixOrder) |
指定した順序を使用して、指定したスケール ベクター ( |
Scale(Single, Single)
スケール ベクターを前に付加することで、指定したスケール ベクターをこの Matrix に適用します。
public:
void Scale(float scaleX, float scaleY);
public void Scale (float scaleX, float scaleY);
member this.Scale : single * single -> unit
Public Sub Scale (scaleX As Single, scaleY As Single)
パラメーター
例
例については、「Scale(Single, Single, MatrixOrder)」を参照してください。
適用対象
Scale(Single, Single, MatrixOrder)
指定した順序を使用して、指定したスケール ベクター (scaleX
と scaleY
) をこの Matrix に適用します。
public:
void Scale(float scaleX, float scaleY, System::Drawing::Drawing2D::MatrixOrder order);
public void Scale (float scaleX, float scaleY, System.Drawing.Drawing2D.MatrixOrder order);
member this.Scale : single * single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub Scale (scaleX As Single, scaleY As Single, order As MatrixOrder)
パラメーター
- order
- MatrixOrder
この Matrix にスケール ベクターを適用する順序 (前後どちらに付加するか) を指定する MatrixOrder。
例
次のコード例は、Windows フォームで使用するように設計されており、イベント オブジェクトがPaint必要PaintEventArgse
です。 コードは、次のアクションを実行します。
スケーリング変換 (青い四角形) を適用する前に、画面に四角形を描画します。
行列を作成し、x 軸に 3、y 軸に 2 ずつスケーリングします。
このマトリックス変換を四角形に適用します。
変換された四角形を画面 (赤い四角形) に描画します。
赤い四角形は、四角形の左上隅 (四角形の始点) を含め、x 軸では 3、y 軸では 2 の係数でスケーリングされていることに注意してください。
public:
void ScaleExample( PaintEventArgs^ e )
{
Pen^ myPen = gcnew Pen( Color::Blue,1.0f );
Pen^ myPen2 = gcnew Pen( Color::Red,1.0f );
// Draw the rectangle to the screen before applying the
// transform.
e->Graphics->DrawRectangle( myPen, 50, 50, 100, 100 );
// Create a matrix and scale it.
Matrix^ myMatrix = gcnew Matrix;
myMatrix->Scale( 3, 2, MatrixOrder::Append );
// Draw the rectangle to the screen again after applying the
// transform.
e->Graphics->Transform = myMatrix;
e->Graphics->DrawRectangle( myPen2, 50, 50, 100, 100 );
}
public void ScaleExample(PaintEventArgs e)
{
Pen myPen = new Pen(Color.Blue, 1);
Pen myPen2 = new Pen(Color.Red, 1);
// Draw the rectangle to the screen before applying the
// transform.
e.Graphics.DrawRectangle(myPen, 50, 50, 100, 100);
// Create a matrix and scale it.
Matrix myMatrix = new Matrix();
myMatrix.Scale(3, 2, MatrixOrder.Append);
// Draw the rectangle to the screen again after applying the
// transform.
e.Graphics.Transform = myMatrix;
e.Graphics.DrawRectangle(myPen2, 50, 50, 100, 100);
}
Public Sub ScaleExample(ByVal e As PaintEventArgs)
Dim myPen As New Pen(Color.Blue, 1)
Dim myPen2 As New Pen(Color.Red, 1)
' Draw the rectangle to the screen before applying the
' transform.
e.Graphics.DrawRectangle(myPen, 50, 50, 100, 100)
' Create a matrix and scale it.
Dim myMatrix As New Matrix
myMatrix.Scale(3, 2, MatrixOrder.Append)
' Draw the rectangle to the screen again after applying the
' transform.
e.Graphics.Transform = myMatrix
e.Graphics.DrawRectangle(myPen2, 50, 50, 100, 100)
End Sub
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback。
近日公開予定: 2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub イシューを段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、以下を参照してください:フィードバックの送信と表示