PathGradientBrush.MultiplyTransform Methode

Definitie

Vermenigvuldigt de Matrix lokale geometrische transformatie van dit PathGradientBrush door de opgegeven door de opgegeven Matrix prepending van de opgegeven Matrix.

Overloads

Name Description
MultiplyTransform(Matrix, MatrixOrder)

Hiermee wordt de transformatiematrix van de borstel bijgewerkt met het product van de transformatiematrix van de borstel vermenigvuldigd met een andere matrix.

MultiplyTransform(Matrix)

Werkt de transformatiematrix van de borstel bij met het product van de transformatiematrix van de borstel vermenigvuldigd met een andere matrix.

MultiplyTransform(Matrix, MatrixOrder)

Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs

Hiermee wordt de transformatiematrix van de borstel bijgewerkt met het product van de transformatiematrix van de borstel vermenigvuldigd met een andere matrix.

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)

Parameters

matrix
Matrix

Dit Matrix wordt vermenigvuldigd met de huidige transformatiematrix van de borstel.

order
MatrixOrder

Een MatrixOrder die aangeeft in welke volgorde de twee matrices moeten worden vermenigvuldigd.

Voorbeelden

Het volgende codevoorbeeld is ontworpen voor gebruik met Windows Forms en vereist PaintEventArgse, een OnPaint-gebeurtenisobject. De code voert de volgende acties uit:

  • Hiermee maakt u een grafisch pad en voegt u er een rechthoek aan toe.

  • Hiermee maakt u een PathGradientBrush van de padpunten (in dit voorbeeld vormen de punten een rechthoek, maar dit kan de meeste vormen zijn).

  • Hiermee stelt u de middelste kleur in op rood en de omringende kleur op blauw.

  • Hiermee tekent u het PathGradientBrush scherm voordat u de vermenigvuldigingstransformatie toepast.

  • Hiermee maakt u een matrix waarmee de borstel 90 graden wordt gedraaid en wordt deze met 100 in beide assen omgezet.

  • Hiermee past u deze matrix toe op het kwast met behulp van de MultiplyTransform methode.

  • Hiermee tekent u de kwast naar het scherm.

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

Van toepassing op

MultiplyTransform(Matrix)

Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs
Bron:
PathGradientBrush.cs

Werkt de transformatiematrix van de borstel bij met het product van de transformatiematrix van de borstel vermenigvuldigd met een andere matrix.

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)

Parameters

matrix
Matrix

Dit Matrix wordt vermenigvuldigd met de huidige transformatiematrix van de borstel.

Voorbeelden

Zie MultiplyTransformvoor een voorbeeld.

Van toepassing op