次の方法で共有


TextureBrush.ScaleTransform メソッド

指定の量だけこの TextureBrush オブジェクトのローカル ジオメトリック変換をスケーリングします。このメソッドは変換の前にスケーリング行列を適用します。

オーバーロードの一覧

指定の量だけこの TextureBrush オブジェクトのローカル ジオメトリック変換をスケーリングします。このメソッドは変換の前にスケーリング行列を適用します。

[Visual Basic] Overloads Public Sub ScaleTransform(Single, Single)

[C#] public void ScaleTransform(float, float);

[C++] public: void ScaleTransform(float, float);

[JScript] public function ScaleTransform(float, float);

指定の量だけ、この TextureBrush オブジェクトのローカル ジオメトリック変換を指定の順序でスケーリングします。

[Visual Basic] Overloads Public Sub ScaleTransform(Single, Single, MatrixOrder)

[C#] public void ScaleTransform(float, float, MatrixOrder);

[C++] public: void ScaleTransform(float, float, MatrixOrder);

[JScript] public function ScaleTransform(float, float, MatrixOrder);

使用例

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

  • TextureBrush オブジェクトを作成します。
  • テクスチャ イメージを x 方向に 2 倍スケーリングします。
  • テクスチャ ブラシを使用して、画面上で四角形を塗りつぶします。

[Visual Basic, C#] メモ   ここでは、ScaleTransform のオーバーロード形式のうちの 1 つだけについて、使用例を示します。その他の例については、各オーバーロード形式のトピックを参照してください。

 
Public Sub ScaleTransform_Example(e As PaintEventArgs)
' Create a TextureBrush object.
Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))
' Scale the texture image 2X in the x-direction.
tBrush.ScaleTransform(2, 1, MatrixOrder.Prepend)
' Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub
        
[C#] 
public void ScaleTransform_Example(PaintEventArgs e)
{
// Create a TextureBrush object.
TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
// Scale the texture image 2X in the x-direction.
tBrush.ScaleTransform(2, 1, MatrixOrder.Prepend);
// Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
        

[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

参照

TextureBrush クラス | TextureBrush メンバ | System.Drawing 名前空間