TextureBrush.ResetTransform メソッド

定義

この TextureBrush オブジェクトの Transform プロパティを ID にリセットします。

public:
 void ResetTransform();
public void ResetTransform ();
member this.ResetTransform : unit -> unit
Public Sub ResetTransform ()

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

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

  • テクスチャ イメージを 90 度回転させます。

  • 四角形を塗りつぶします。

  • 変換マトリックスを ID にリセットします。

  • 2 番目の四角形を塗りつぶします。

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

   // Rotate the texture image by 90 degrees.
   tBrush->RotateTransform( 90 );

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );

   // Reset transformation matrix to identity.
   tBrush->ResetTransform();

   // Fill a rectangle with tBrush.
   e->Graphics->FillRectangle( tBrush, 0, 110, 100, 100 );
}
public void ResetTransform_Example(PaintEventArgs e)
{
             
    // Create a TextureBrush object.
    TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
             
    // Rotate the texture image by 90 degrees.
    tBrush.RotateTransform(90);
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
             
    // Reset transformation matrix to identity.
    tBrush.ResetTransform();
             
    // Fill a rectangle with tBrush.
    e.Graphics.FillRectangle(tBrush, 0, 110, 100, 100);
}
Public Sub ResetTransform_Example(ByVal e As PaintEventArgs)

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

    ' Rotate the texture image by 90 degrees.
    tBrush.RotateTransform(90)

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

    ' Reset transformation matrix to identity.
    tBrush.ResetTransform()

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

適用対象