PathGradientBrush.MultiplyTransform メソッド

定義

指定された Matrix を先に適用するように指定して、PathGradientBrush のローカル ジオメトリック変換を表す Matrix に、この指定された Matrix を乗算します。

オーバーロード

MultiplyTransform(Matrix)

ブラシの変換行列に別の行列を掛け合わせることにより、そのブラシの変換行列を更新します。

MultiplyTransform(Matrix, MatrixOrder)

ブラシの変換行列に別の行列を掛け合わせることにより、そのブラシの変換行列を更新します。

MultiplyTransform(Matrix)

ソース:
PathGradientBrush.cs
ソース:
PathGradientBrush.cs
ソース:
PathGradientBrush.cs

ブラシの変換行列に別の行列を掛け合わせることにより、そのブラシの変換行列を更新します。

public:
 void MultiplyTransform(System::Drawing::Drawing2D::Matrix ^ matrix);
public void MultiplyTransform (System.Drawing.Drawing2D.Matrix matrix);
member this.MultiplyTransform : System.Drawing.Drawing2D.Matrix -> unit
Public Sub MultiplyTransform (matrix As Matrix)

パラメーター

matrix
Matrix

ブラシの現在の変換行列に掛け合わせる Matrix

例については、「MultiplyTransform」を参照してください。

適用対象

MultiplyTransform(Matrix, MatrixOrder)

ソース:
PathGradientBrush.cs
ソース:
PathGradientBrush.cs
ソース:
PathGradientBrush.cs

ブラシの変換行列に別の行列を掛け合わせることにより、そのブラシの変換行列を更新します。

public:
 void MultiplyTransform(System::Drawing::Drawing2D::Matrix ^ matrix, System::Drawing::Drawing2D::MatrixOrder order);
public void MultiplyTransform (System.Drawing.Drawing2D.Matrix matrix, System.Drawing.Drawing2D.MatrixOrder order);
member this.MultiplyTransform : System.Drawing.Drawing2D.Matrix * System.Drawing.Drawing2D.MatrixOrder -> unit
Public Sub MultiplyTransform (matrix As Matrix, order As MatrixOrder)

パラメーター

matrix
Matrix

ブラシの現在の変換行列に掛け合わせる Matrix

order
MatrixOrder

2 つの行列を乗算する順序を指定する MatrixOrder

次のコード例は、Windows フォームで使用するように設計されており、イベント オブジェクトがOnPaint必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • グラフィックス パスを作成し、四角形を追加します。

  • PathGradientBrushパスポイントから を作成します (この例では、ポイントは四角形を形成しますが、ほとんどの図形である可能性があります)。

  • 中心の色を赤に設定し、周囲の色を青に設定します。

  • 乗算変換を PathGradientBrush 適用する前に、 を画面に描画します。

  • ブラシを 90 度回転させ、両方の軸で 100 回転させる行列を作成します。

  • メソッドを使用してブラシにこのマトリックスを MultiplyTransform 適用します。

  • 画面にブラシを描画します。

public:
   void MultiplyTransformExample( PaintEventArgs^ e )
   {
      // Create a graphics path and add an rectangle.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      Rectangle rect = Rectangle(20,20,100,50);
      myPath->AddRectangle( rect );

      // Get the path's array of points.
      array<PointF>^myPathPointArray = myPath->PathPoints;

      // Create a path gradient brush.
      PathGradientBrush^ myPGBrush = gcnew PathGradientBrush( myPathPointArray );

      // Set the color span.
      myPGBrush->CenterColor = Color::Red;
      array<Color>^ mySurroundColor = {Color::Blue};
      myPGBrush->SurroundColors = mySurroundColor;

      // Draw the brush to the screen prior to transformation.
      e->Graphics->FillRectangle( myPGBrush, 10, 10, 200, 200 );

      // Create a new matrix that rotates by 90 degrees, and
      // translates by 100 in each direction.
      Matrix^ myMatrix = gcnew Matrix( 0,1,-1,0,100,100 );

      // Apply the transform to the brush.
      myPGBrush->MultiplyTransform( myMatrix, MatrixOrder::Append );

      // Draw the brush to the screen again after applying the
      // transform.
      e->Graphics->FillRectangle( myPGBrush, 10, 10, 200, 300 );
   }
public void MultiplyTransformExample(PaintEventArgs e)
{
             
    // Create a graphics path and add an rectangle.
    GraphicsPath myPath = new GraphicsPath();
    Rectangle rect = new Rectangle(20, 20, 100, 50);
    myPath.AddRectangle(rect);
             
    // Get the path's array of points.
    PointF[] myPathPointArray = myPath.PathPoints;
             
    // Create a path gradient brush.
    PathGradientBrush myPGBrush = new
        PathGradientBrush(myPathPointArray);
             
    // Set the color span.
    myPGBrush.CenterColor = Color.Red;
    Color[] mySurroundColor = {Color.Blue};
    myPGBrush.SurroundColors = mySurroundColor;
             
    // Draw the brush to the screen prior to transformation.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 200);
             
    // Create a new matrix that rotates by 90 degrees, and
    // translates by 100 in each direction.
    Matrix myMatrix = new Matrix(0, 1, -1, 0, 100, 100);
             
    // Apply the transform to the brush.
    myPGBrush.MultiplyTransform(myMatrix, MatrixOrder.Append);
             
    // Draw the brush to the screen again after applying the
    // transform.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 300);
}
Public Sub MultiplyTransformExample(ByVal e As PaintEventArgs)

    ' Create a graphics path and add a rectangle.
    Dim myPath As New GraphicsPath
    Dim rect As New Rectangle(20, 20, 100, 50)
    myPath.AddRectangle(rect)

    ' Get the path's array of points.
    Dim myPathPointArray As PointF() = myPath.PathPoints

    ' Create a path gradient brush.
    Dim myPGBrush As New PathGradientBrush(myPathPointArray)

    ' Set the color span.
    myPGBrush.CenterColor = Color.Red
    Dim mySurroundColor As Color() = {Color.Blue}
    myPGBrush.SurroundColors = mySurroundColor

    ' Draw the brush to the screen prior to transformation.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 200)

    ' Create a new matrix that rotates by 90 degrees, and
    ' translates by 100 in each direction.
    Dim myMatrix As New Matrix(0, 1, -1, 0, 100, 100)

    ' Apply the transform to the brush.
    myPGBrush.MultiplyTransform(myMatrix, MatrixOrder.Append)

    ' Draw the brush to the screen again after applying the
    ' transform.
    e.Graphics.FillRectangle(myPGBrush, 10, 10, 200, 300)
End Sub

適用対象