TextureBrush.ResetTransform Metodo

Definizione

Reimposta la proprietà Transform di questo oggetto TextureBrush sull'identità.

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

Esempio

L'esempio seguente è progettato per l'uso con Windows Forms e richiede PaintEventArgs e, che è un parametro del Paint gestore eventi. Il codice esegue le azioni seguenti:

  • Crea un oggetto TextureBrush.

  • Ruota l'immagine della trama di 90 gradi.

  • Riempie un rettangolo.

  • Reimposta la matrice di trasformazione sull'identità.

  • Riempie un secondo rettangolo.

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.

Si applica a