TextureBrush.TranslateTransform メソッド

定義

指定した順序で、指定した寸法だけこの TextureBrush オブジェクトのローカル ジオメトリック変換を平行移動します。

オーバーロード

TranslateTransform(Single, Single)

指定した寸法でこの TextureBrush オブジェクトのローカル ジオメトリック変換を平行移動します。 このメソッドは変換の前に平行移動を行います。

TranslateTransform(Single, Single, MatrixOrder)

指定した順序で、指定した寸法だけこの TextureBrush オブジェクトのローカル ジオメトリック変換を平行移動します。

TranslateTransform(Single, Single)

ソース:
TextureBrush.cs
ソース:
TextureBrush.cs
ソース:
TextureBrush.cs

指定した寸法でこの TextureBrush オブジェクトのローカル ジオメトリック変換を平行移動します。 このメソッドは変換の前に平行移動を行います。

public:
 void TranslateTransform(float dx, float dy);
public void TranslateTransform (float dx, float dy);
member this.TranslateTransform : single * single -> unit
Public Sub TranslateTransform (dx As Single, dy As Single)

パラメーター

dx
Single

X 方向に変換を平行移動するディメンションです。

dy
Single

Y 方向に変換を平行移動するディメンションです。

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

  • TextureBrush オブジェクトを作成します。

  • テクスチャ イメージを x 方向に 50 単位移動します。

  • テクスチャ ブラシを使用して、画面上の四角形を塗りつぶします。

void TranslateTransform_Example1( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Move the texture image 2X in the x-direction.
   tBrush->TranslateTransform( 50, 0, MatrixOrder::Prepend );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void TranslateTransform_Example1(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0, MatrixOrder.Prepend);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub TranslateTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0, MatrixOrder.Prepend)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub

適用対象

TranslateTransform(Single, Single, MatrixOrder)

ソース:
TextureBrush.cs
ソース:
TextureBrush.cs
ソース:
TextureBrush.cs

指定した順序で、指定した寸法だけこの TextureBrush オブジェクトのローカル ジオメトリック変換を平行移動します。

public:
 void TranslateTransform(float dx, float dy, System::Drawing::Drawing2D::MatrixOrder order);
public void TranslateTransform (float dx, float dy, System.Drawing.Drawing2D.MatrixOrder order);
member this.TranslateTransform : single * single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub TranslateTransform (dx As Single, dy As Single, order As MatrixOrder)

パラメーター

dx
Single

X 方向に変換を平行移動するディメンションです。

dy
Single

Y 方向に変換を平行移動するディメンションです。

order
MatrixOrder

平行移動を適用する順序 (前または後)。

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

  • TextureBrush オブジェクトを作成します。

  • テクスチャ イメージを x 方向に 50 単位移動します。

  • テクスチャ ブラシを使用して、画面上の四角形を塗りつぶします。

void TranslateTransform_Example2( PaintEventArgs^ e )
{
   // Create a TextureBrush object.
   TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );

   // Move the texture image 2X in the x-direction.
   tBrush->TranslateTransform( 50, 0 );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void TranslateTransform_Example2(PaintEventArgs e)
{
         
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
         
    // Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0);
         
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub TranslateTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a TextureBrush object.
    Dim tBrush As New TextureBrush(New Bitmap("texture.jpg"))

    ' Move the texture image 2X in the x-direction.
    tBrush.TranslateTransform(50, 0)

    ' Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub

適用対象