Graphics.RotateTransform Méthode

Définition

Applique la rotation spécifiée à la matrice de transformation de ce Graphics.

Surcharges

Nom Description
RotateTransform(Single, MatrixOrder)

Applique la rotation spécifiée à la matrice de transformation de celle-ci Graphics dans l’ordre spécifié.

RotateTransform(Single)

Applique la rotation spécifiée à la matrice de transformation de ce Graphics.

RotateTransform(Single, MatrixOrder)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Applique la rotation spécifiée à la matrice de transformation de celle-ci Graphics dans l’ordre spécifié.

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 en degrés.

order
MatrixOrder

Membre de l’énumération MatrixOrder qui spécifie si la rotation est ajoutée ou ajoutée à la transformation de matrice.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms, et nécessite PaintEventArgse, qui est un paramètre du gestionnaire d’événements Paint. Le code effectue les actions suivantes :

  • Traduit la matrice de transformation mondiale de la forme Windows par le vecteur (100, 0).

  • Fait pivoter la transformation du monde à l’aide d’un angle de 30 degrés, en ajoutant la matrice de rotation à la matrice de transformation mondiale avec Append.

  • Dessine un ellipse traduit et pivoté avec un stylet bleu.

public:
   void RotateTransformAngleMatrixOrder( PaintEventArgs^ e )
   {
      // Set world transform of graphics object to translate.
      e->Graphics->TranslateTransform( 100.0F, 0.0F );

      // Then to rotate, appending rotation matrix.
      e->Graphics->RotateTransform( 30.0F, MatrixOrder::Append );

      // Draw translated, rotated ellipse to screen.
      e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), 0, 0, 200, 80 );
   }
private void RotateTransformAngleMatrixOrder(PaintEventArgs e)
{

    // Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F);

    // Then to rotate, appending rotation matrix.
    e.Graphics.RotateTransform(30.0F, MatrixOrder.Append);

    // Draw translated, rotated ellipse to screen.
    e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
}
Private Sub RotateTransformAngleMatrixOrder(ByVal e As PaintEventArgs)

    ' Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F)

    ' Then to rotate, appending rotation matrix.
    e.Graphics.RotateTransform(30.0F, MatrixOrder.Append)

    ' Draw translated, rotated ellipse to screen.
    e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), 0, 0, 200, 80)
End Sub

Remarques

L’opération de rotation consiste à multiplier la matrice de transformation par une matrice dont les éléments sont dérivés du angle paramètre. Cette méthode précède ou ajoute la matrice de transformation de la Graphics matrice de rotation en fonction du order paramètre.

S’applique à

RotateTransform(Single)

Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs
Source:
Graphics.cs

Applique la rotation spécifiée à la matrice de transformation de ce Graphics.

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 en degrés.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms, et nécessite PaintEventArgse, qui est un paramètre du gestionnaire d’événements Paint. Le code effectue les actions suivantes :

  • Traduit la matrice de transformation mondiale de la forme Windows par le vecteur (100, 0).

  • Fait pivoter la transformation du monde à un angle de 30 degrés, en préinitant la matrice de rotation vers la matrice de transformation du monde.

  • Dessine un ellipse pivoté et traduit avec un stylet bleu.

public:
   void RotateTransformAngle( PaintEventArgs^ e )
   {
      // Set world transform of graphics object to translate.
      e->Graphics->TranslateTransform( 100.0F, 0.0F );

      // Then to rotate, prepending rotation matrix.
      e->Graphics->RotateTransform( 30.0F );

      // Draw rotated, translated ellipse to screen.
      e->Graphics->DrawEllipse( gcnew Pen( Color::Blue,3.0f ), 0, 0, 200, 80 );
   }
private void RotateTransformAngle(PaintEventArgs e)
{

    // Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F);

    // Then to rotate, prepending rotation matrix.
    e.Graphics.RotateTransform(30.0F);

    // Draw rotated, translated ellipse to screen.
    e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
}
Private Sub RotateTransformAngle(ByVal e As PaintEventArgs)

    ' Set world transform of graphics object to translate.
    e.Graphics.TranslateTransform(100.0F, 0.0F)

    ' Then to rotate, prepending rotation matrix.
    e.Graphics.RotateTransform(30.0F)

    ' Draw rotated, translated ellipse to screen.
    e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), 0, 0, 200, 80)
End Sub

Remarques

L’opération de rotation consiste à multiplier la matrice de transformation par une matrice dont les éléments sont dérivés du angle paramètre. Cette méthode applique la rotation en la préparant à la matrice de transformation.

S’applique à