Freigeben über


TextureBrush.ResetTransform-Methode

Setzt die Transform-Eigenschaft dieses TextureBrush-Objekts auf Identität zurück.

Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)

Syntax

'Declaration
Public Sub ResetTransform
'Usage
Dim instance As TextureBrush

instance.ResetTransform
public void ResetTransform ()
public:
void ResetTransform ()
public void ResetTransform ()
public function ResetTransform ()

Rückgabewert

Diese Methode gibt keinen Wert zurück.

Beispiel

Das folgende Beispiel ist für die Verwendung mit Windows Forms vorgesehen und erfordert PaintEventArgse, wobei es sich um einen Parameter des Paint-Ereignishandlers handelt. Der Code führt die folgenden Aktionen aus:

  • Erstellt ein TextureBrush-Objekt.

  • Dreht das Strukturbild um 90 Grad.

  • Füllt ein Rechteck.

  • Setzt die Transformationsmatrix auf Identität zurück.

  • Füllt ein zweites Rechteck.

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.
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);
}
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.get_Graphics().FillRectangle(tBrush, 0, 0, 100, 100);

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

    // Fill a rectangle with tBrush.
    e.get_Graphics().FillRectangle(tBrush, 0, 110, 100, 100);
} //ResetTransform_Example

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

TextureBrush-Klasse
TextureBrush-Member
System.Drawing-Namespace