Graphics.ScaleTransformとは? わかりやすく解説

Graphics.ScaleTransform メソッド


Graphics.ScaleTransform メソッド (Single, Single, MatrixOrder)

この Graphics の変換行列に、指定したスケーリング操作を指定した順序で適用します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub ScaleTransform ( _
    sx As Single, _
    sy As Single, _
    order As MatrixOrder _
)
Dim instance As Graphics
Dim sx As Single
Dim sy As Single
Dim order As MatrixOrder

instance.ScaleTransform(sx, sy, order)
public void ScaleTransform (
    float sx,
    float sy,
    MatrixOrder order
)
public:
void ScaleTransform (
    float sx, 
    float sy, 
    MatrixOrder order
)
public void ScaleTransform (
    float sx, 
    float sy, 
    MatrixOrder order
)
public function ScaleTransform (
    sx : float, 
    sy : float, 
    order : MatrixOrder
)

パラメータ

sx

x 方向のスケール ファクタ。

sy

y 方向のスケール ファクタ。

order

スケーリング操作が変換行列の前に付加されるか後ろに追加されるかを指定する MatrixOrder 列挙体のメンバ。

解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

平行四辺形が生成されます。

Public Sub ScaleTransformFloatMatrixOrder(ByVal
 e As PaintEventArgs)

    ' Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F)

    ' Then to scale, appending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Append)

    ' Draw rotated, scaled rectangle to screen.
    e.Graphics.DrawRectangle(New Pen(Color.Blue, 3), 50, 0, 100,
 40)
End Sub
public void ScaleTransformFloatMatrixOrder(PaintEventArgs
 e)
{

    // Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F);

    // Then to scale, appending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Append);

    // Draw rotated, scaled rectangle to screen.
    e.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100,
 40);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.ScaleTransform メソッド (Single, Single)

この Graphics の変換行列の前に指定したスケーリング操作を付加することによって、この変換行列にスケーリング操作を適用します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub ScaleTransform ( _
    sx As Single, _
    sy As Single _
)
Dim instance As Graphics
Dim sx As Single
Dim sy As Single

instance.ScaleTransform(sx, sy)
public void ScaleTransform (
    float sx,
    float sy
)
public:
void ScaleTransform (
    float sx, 
    float sy
)
public void ScaleTransform (
    float sx, 
    float sy
)
public function ScaleTransform (
    sx : float, 
    sy : float
)

パラメータ

sx

x 方向のスケール ファクタ。

sy

y 方向のスケール ファクタ。

解説解説
使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

四角形のままです。

Public Sub ScaleTransformFloat(ByVal
 e As PaintEventArgs)

    ' Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F)

    ' Then to scale, prepending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F)

    ' Draw scaled, rotated rectangle to screen.
    e.Graphics.DrawRectangle(New Pen(Color.Blue, 3), 50, 0, 100,
 40)
End Sub
public void ScaleTransformFloat(PaintEventArgs
 e)
{

    // Set world transform of graphics object to rotate.
    e.Graphics.RotateTransform(30.0F);

    // Then to scale, prepending to world transform.
    e.Graphics.ScaleTransform(3.0F, 1.0F);

    // Draw scaled, rotated rectangle to screen.
    e.Graphics.DrawRectangle(new Pen(Color.Blue, 3), 50, 0, 100,
 40);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「Graphics.ScaleTransform」の関連用語

Graphics.ScaleTransformのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



Graphics.ScaleTransformのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS