TextureBrush.ResetTransform Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Resetuje Transform
właściwość tego TextureBrush obiektu do tożsamości.
public:
void ResetTransform();
public void ResetTransform ();
member this.ResetTransform : unit -> unit
Public Sub ResetTransform ()
Przykłady
Poniższy przykład jest przeznaczony do użycia z Windows Forms i wymaga PaintEventArgse
parametru Paint
programu obsługi zdarzeń. Kod wykonuje następujące akcje:
Tworzy obiekt TextureBrush.
Obraca obraz tekstury o 90 stopni.
Wypełnia prostokąt.
Resetuje macierz przekształcania do tożsamości.
Wypełnia drugi prostokąt.
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.
Dotyczy
Opinia
https://aka.ms/ContentUserFeedback.
Dostępne już wkrótce: W 2024 r. będziemy stopniowo wycofywać zgłoszenia z serwisu GitHub jako mechanizm przesyłania opinii na temat zawartości i zastępować go nowym systemem opinii. Aby uzyskać więcej informacji, sprawdź:Prześlij i wyświetl opinię dla