TextureBrush.RotateTransform Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Fait pivoter la transformation géométrique locale de cet objet TextureBrush selon la quantité spécifiée. Cette méthode ajoute la rotation avant la transformation.
Surcharges
RotateTransform(Single) |
Fait pivoter la transformation géométrique locale de cet objet TextureBrush selon la quantité spécifiée. Cette méthode ajoute la rotation avant la transformation. |
RotateTransform(Single, MatrixOrder) |
Fait pivoter la transformation géométrique locale de cet objet TextureBrush dans la mesure spécifiée et dans l’ordre indiqué. |
RotateTransform(Single)
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
Fait pivoter la transformation géométrique locale de cet objet TextureBrush selon la quantité spécifiée. Cette méthode ajoute la rotation avant la transformation.
public:
void RotateTransform(float angle);
public void RotateTransform (float angle);
member this.RotateTransform : single -> unit
Public Sub RotateTransform (angle As Single)
Paramètres
- angle
- Single
Angle de rotation.
Exemples
L’exemple suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse
, qui est un paramètre du Paint
gestionnaire d’événements. Le code effectue les actions suivantes :
Crée un objet TextureBrush.
Fait pivoter l’image de texture de 90 degrés.
Remplit un rectangle.
void RotateTransform_Example1( 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 );
}
public void RotateTransform_Example1(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);
}
Public Sub RotateTransform_Example1(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)
End Sub
S’applique à
RotateTransform(Single, MatrixOrder)
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
- Source:
- TextureBrush.cs
Fait pivoter la transformation géométrique locale de cet objet TextureBrush dans la mesure spécifiée et dans l’ordre indiqué.
public:
void RotateTransform(float angle, System::Drawing::Drawing2D::MatrixOrder order);
public void RotateTransform (float angle, System.Drawing.Drawing2D.MatrixOrder order);
member this.RotateTransform : single * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub RotateTransform (angle As Single, order As MatrixOrder)
Paramètres
- angle
- Single
Angle de rotation.
- order
- MatrixOrder
Énumération MatrixOrder qui spécifie si la matrice de rotation doit être ajoutée avant ou après.
Exemples
L’exemple suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse
, qui est un paramètre du Paint
gestionnaire d’événements. Le code effectue les actions suivantes :
Crée un objet TextureBrush.
Fait pivoter l’image de texture de 90 degrés.
Remplit un rectangle.
void RotateTransform_Example2( PaintEventArgs^ e )
{
// Create a TextureBrush object.
TextureBrush^ tBrush = gcnew TextureBrush( gcnew Bitmap( "texture.jpg" ) );
// Rotate the texture image by 90 degrees.
tBrush->RotateTransform( 90, MatrixOrder::Prepend );
// Fill a rectangle with tBrush.
e->Graphics->FillRectangle( tBrush, 0, 0, 100, 100 );
}
public void RotateTransform_Example2(PaintEventArgs e)
{
// Create a TextureBrush object.
TextureBrush tBrush = new TextureBrush(new Bitmap("texture.jpg"));
// Rotate the texture image by 90 degrees.
tBrush.RotateTransform(90, MatrixOrder.Prepend);
// Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100);
}
Public Sub RotateTransform_Example2(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, MatrixOrder.Prepend)
' Fill a rectangle with tBrush.
e.Graphics.FillRectangle(tBrush, 0, 0, 100, 100)
End Sub
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour