LinearGradientBrush.RotateTransform メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した分量だけローカル ジオメトリック変換を回転します。 このメソッドは変換の前に回転を行います。
オーバーロード
RotateTransform(Single) |
指定した分量だけローカル ジオメトリック変換を回転します。 このメソッドは変換の前に回転を行います。 |
RotateTransform(Single, MatrixOrder) |
指定した順序で、指定した分量だけローカル ジオメトリック変換を回転します。 |
RotateTransform(Single)
指定した分量だけローカル ジオメトリック変換を回転します。 このメソッドは変換の前に回転を行います。
public:
void RotateTransform(float angle);
public void RotateTransform (float angle);
member this.RotateTransform : single -> unit
Public Sub RotateTransform (angle As Single)
パラメーター
- angle
- Single
回転角度。
例
例については、「RotateTransform」を参照してください。
適用対象
RotateTransform(Single, MatrixOrder)
指定した順序で、指定した分量だけローカル ジオメトリック変換を回転します。
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 フォームで使用するように設計されており、イベント オブジェクトがOnPaint必要PaintEventArgse
です。 コード
新しい LinearGradientBrush を作成します。
このブラシを使用して、画面に楕円を描画します。
メソッドを LinearGradientBrush 呼び出 RotateTransform して 45 度回転します。
回転したブラシを使用して、最初の楕円のすぐ下の画面に楕円を描画します。
下楕円のグラデーションは、上楕円の x 軸に対して 45 度の角度であることに注意してください。 また、 メソッドの TranslateTransform 呼び出しを使用して、グラデーションの塗りつぶしの左端を下の楕円の左端に揃えます。
private:
void RotateTransformExample( PaintEventArgs^ e )
{
// Create a LinearGradientBrush.
Rectangle myRect = Rectangle(20,20,200,100);
LinearGradientBrush^ myLGBrush = gcnew LinearGradientBrush( myRect,Color::Blue,Color::Red,0.0f,true );
// Draw an ellipse to the screen using the LinearGradientBrush.
e->Graphics->FillEllipse( myLGBrush, myRect );
// Rotate the LinearGradientBrush.
myLGBrush->RotateTransform( 45.0f, MatrixOrder::Prepend );
// Rejustify the brush to start at the left edge of the ellipse.
myLGBrush->TranslateTransform( -100.0f, 0.0f );
// Draw a second ellipse to the screen using
// the transformed brush.
e->Graphics->FillEllipse( myLGBrush, 20, 150, 200, 100 );
}
private void RotateTransformExample(PaintEventArgs e)
{
// Create a LinearGradientBrush.
Rectangle myRect = new Rectangle(20, 20, 200, 100);
LinearGradientBrush myLGBrush = new LinearGradientBrush(
myRect, Color.Blue, Color.Red, 0.0f, true);
// Draw an ellipse to the screen using the LinearGradientBrush.
e.Graphics.FillEllipse(myLGBrush, myRect);
// Rotate the LinearGradientBrush.
myLGBrush.RotateTransform(45.0f, MatrixOrder.Prepend);
// Rejustify the brush to start at the left edge of the ellipse.
myLGBrush.TranslateTransform(-100.0f, 0.0f);
// Draw a second ellipse to the screen using
// the transformed brush.
e.Graphics.FillEllipse(myLGBrush, 20, 150, 200, 100);
}
Public Sub RotateTransformExample(ByVal e As PaintEventArgs)
' Create a LinearGradientBrush.
Dim myRect As New Rectangle(20, 20, 200, 100)
Dim myLGBrush As New LinearGradientBrush(myRect, Color.Blue, _
Color.Red, 0.0F, True)
' Draw an ellipse to the screen using the LinearGradientBrush.
e.Graphics.FillEllipse(myLGBrush, myRect)
' Rotate the LinearGradientBrush.
myLGBrush.RotateTransform(45.0F, MatrixOrder.Prepend)
' Rejustify the brush to start at the left edge of the ellipse.
myLGBrush.TranslateTransform(-100.0F, 0.0F)
' Draw a second ellipse to the screen using the transformed brush.
e.Graphics.FillEllipse(myLGBrush, 20, 150, 200, 100)
End Sub
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示