Graphics.RotateTransform メソッド

定義

この Graphics の変換行列に、指定した回転を適用します。

オーバーロード

RotateTransform(Single)

この Graphics の変換行列に、指定した回転を適用します。

RotateTransform(Single, MatrixOrder)

この Graphics の変換行列に、指定した回転を指定した順序で適用します。

RotateTransform(Single)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

この Graphics の変換行列に、指定した回転を適用します。

public:
 void RotateTransform(float angle);
public void RotateTransform (float angle);
member this.RotateTransform : single -> unit
Public Sub RotateTransform (angle As Single)

パラメーター

angle
Single

回転角度。

次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • Windows フォームのワールド変換行列をベクター (100、0) で変換します。

  • ワールド変換を 30 度の角度で回転し、回転行列をワールド変換行列に優先します。

  • 回転した翻訳された楕円を青いペンで描画します。

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

注釈

回転操作は、変換行列にパラメーターから派生した要素を持つ行列を angle 乗算して構成されます。 このメソッドは、変換マトリックスに事前に設定することで回転を適用します。

適用対象

RotateTransform(Single, MatrixOrder)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

この Graphics の変換行列に、指定した回転を指定した順序で適用します。

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)

パラメーター

angle
Single

回転角度。

order
MatrixOrder

回転が行列変換の後ろに追加されるか前に付加されるかを指定する MatrixOrder 列挙体のメンバー。

次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • Windows フォームのワールド変換行列をベクター (100、0) で変換します。

  • ワールド変換を 30 度の角度で回転し、 を使用して回転行列をワールド変換行列に Append追加します。

  • 青いペンを使用して、回転した平行移動された楕円を描画します。

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

注釈

回転操作は、変換行列にパラメーターから派生した要素を持つ行列を angle 乗算して構成されます。 このメソッドは、 パラメーターに従って回転行列によって の Graphics 変換行列の前に order 追加または追加します。

適用対象