Pen.RotateTransform メソッド

定義

指定した角度だけローカル ジオメトリック変換を回転します。 このメソッドは変換の前に回転を行います。

オーバーロード

RotateTransform(Single, MatrixOrder)

指定した順序で、指定した角度だけローカル ジオメトリック変換を回転します。

RotateTransform(Single)

指定した角度だけローカル ジオメトリック変換を回転します。 このメソッドは変換の前に回転を行います。

RotateTransform(Single, MatrixOrder)

ソース:
Pen.cs
ソース:
Pen.cs
ソース:
Pen.cs

指定した順序で、指定した角度だけローカル ジオメトリック変換を回転します。

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です。 コードは、次のアクションを実行します。

  • Pen を作成します。

  • ペンを x 軸方向に 2 倍にスケーリングします。

  • ペンを使用して四角形を描画します。

  • ペンを時計回りに 90 度回転させます。

  • 2 番目の四角形を描画して、違いを示します。

public:
   void RotateTransform_Example2( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ rotatePen = gcnew Pen( Color::Black,5.0f );
      
      // Scale rotatePen by 2X in the x-direction.
      rotatePen->ScaleTransform( 2, 1 );
      
      // Draw a rectangle with rotatePen.
      e->Graphics->DrawRectangle( rotatePen, 10, 10, 100, 100 );
      
      // Rotate rotatePen 90 degrees clockwise.
      rotatePen->RotateTransform( 90, MatrixOrder::Append );
      
      // Draw a second rectangle with rotatePen.
      e->Graphics->DrawRectangle( rotatePen, 120, 10, 100, 100 );
   }
public void RotateTransform_Example2(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen rotatePen = new Pen(Color.Black, 5);
             
    // Scale rotatePen by 2X in the x-direction.
    rotatePen.ScaleTransform(2, 1);
             
    // Draw a rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 10, 10, 100, 100);
             
    // Rotate rotatePen 90 degrees clockwise.
    rotatePen.RotateTransform(90, MatrixOrder.Append);
             
    // Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 120, 10, 100, 100);
}
Public Sub RotateTransform_Example2(ByVal e As PaintEventArgs)

    ' Create a Pen object.
    Dim rotatePen As New Pen(Color.Black, 5)

    ' Scale rotatePen by 2X in the x-direction.
    rotatePen.ScaleTransform(2, 1)

    ' Draw a rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 10, 10, 100, 100)

    ' Rotate rotatePen 90 degrees clockwise.
    rotatePen.RotateTransform(90, MatrixOrder.Append)

    ' Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 120, 10, 100, 100)
End Sub

注釈

ペンの図形は円形であるため、ペンが x 軸方向または y 軸方向に拡大縮小されない限り、回転は表示されません。

適用対象

RotateTransform(Single)

ソース:
Pen.cs
ソース:
Pen.cs
ソース:
Pen.cs

指定した角度だけローカル ジオメトリック変換を回転します。 このメソッドは変換の前に回転を行います。

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です。 コードは、次のアクションを実行します。

  • Pen を作成します。

  • ペンを使用して四角形を描画します。

  • ペンを x 軸方向に 2 倍にスケーリングします。

  • ペンを時計回りに 90 度回転させます。

  • 2 番目の四角形を描画して、違いを示します。

public:
   void RotateTransform_Example1( PaintEventArgs^ e )
   {
      
      // Create a Pen object.
      Pen^ rotatePen = gcnew Pen( Color::Black,5.0f );
      
      // Draw a rectangle with rotatePen.
      e->Graphics->DrawRectangle( rotatePen, 10, 10, 100, 100 );
      
      // Scale rotatePen by 2X in the x-direction.
      rotatePen->ScaleTransform( 2, 1 );
      
      // Rotate rotatePen 90 degrees clockwise.
      rotatePen->RotateTransform( 90 );
      
      // Draw a second rectangle with rotatePen.
      e->Graphics->DrawRectangle( rotatePen, 140, 10, 100, 100 );
   }
public void RotateTransform_Example1(PaintEventArgs e)
{
             
    // Create a Pen object.
    Pen rotatePen = new Pen(Color.Black, 5);
             
    // Draw a rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 10, 10, 100, 100);
             
    // Scale rotatePen by 2X in the x-direction.
    rotatePen.ScaleTransform(2, 1);
             
    // Rotate rotatePen 90 degrees clockwise.
    rotatePen.RotateTransform(90);
             
    // Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 140, 10, 100, 100);
}
Public Sub RotateTransform_Example1(ByVal e As PaintEventArgs)

    ' Create a Pen object.
    Dim rotatePen As New Pen(Color.Black, 5)

    ' Draw a rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 10, 10, 100, 100)

    ' Scale rotatePen by 2X in the x-direction.
    rotatePen.ScaleTransform(2, 1)

    ' Rotate rotatePen 90 degrees clockwise.
    rotatePen.RotateTransform(90)

    ' Draw a second rectangle with rotatePen.
    e.Graphics.DrawRectangle(rotatePen, 140, 10, 100, 100)
End Sub

注釈

ペンの図形は円形であるため、ペンが x 軸方向または y 軸方向に拡大縮小されない限り、回転は表示されません。

適用対象