LinearGradientBrush.MultiplyTransform Méthode

Définition

Multiplie le Matrix qui représente la transformation géométrique locale de ce LinearGradientBrush par le Matrix spécifié en ajoutant au début le Matrix spécifié.Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix by prepending the specified Matrix.

Surcharges

MultiplyTransform(Matrix, MatrixOrder)

Multiplie le Matrix qui représente la transformation géométrique locale de ce LinearGradientBrush par le Matrix spécifié dans l'ordre donné.Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix in the specified order.

MultiplyTransform(Matrix)

Multiplie le Matrix qui représente la transformation géométrique locale de ce LinearGradientBrush par le Matrix spécifié en ajoutant au début le Matrix spécifié.Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix by prepending the specified Matrix.

MultiplyTransform(Matrix, MatrixOrder)

Multiplie le Matrix qui représente la transformation géométrique locale de ce LinearGradientBrush par le Matrix spécifié dans l'ordre donné.Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix in the specified order.

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)

Paramètres

matrix
Matrix

Matrix par lequel multiplier la transformation géométrique.The Matrix by which to multiply the geometric transform.

order
MatrixOrder

MatrixOrder qui spécifie l'ordre de multiplication des deux matrices.A MatrixOrder that specifies in which order to multiply the two matrices.

Exemples

L’exemple de code suivant est conçu pour être utilisé avec Windows Forms, et il requiert PaintEventArgs e un OnPaint objet d’événement.The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, an OnPaint event object. Le code effectue les actions suivantes :The code performs the following actions:

Notez que l’ellipse inférieure est étirée dans le sens horizontal et que le dégradé est étiré pour correspondre à la nouvelle forme.Notice that the lower ellipse is stretched in the horizontal direction, and that the gradient is stretched to match the new shape.

private:
   void MultiplyTransformExample( 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 );

      // Transform the LinearGradientBrush.
      array<Point>^ transformArray = {Point(20,150),Point(400,150),Point(20,200)};
      Matrix^ myMatrix = gcnew Matrix( myRect,transformArray );
      myLGBrush->MultiplyTransform( myMatrix, MatrixOrder::Prepend );

      // Draw a second ellipse to the screen using
      // the transformed brush.
      e->Graphics->FillEllipse( myLGBrush, 20, 150, 380, 50 );
   }
 private void MultiplyTransformExample(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);
              
     // Transform the LinearGradientBrush.
     Point[] transformArray = { new Point(20, 150),
          new Point(400,150), new Point(20, 200) };

     Matrix myMatrix = new Matrix(myRect, transformArray);
     myLGBrush.MultiplyTransform(
         myMatrix,
         MatrixOrder.Prepend);
              
     // Draw a second ellipse to the screen using
     // the transformed brush.
     e.Graphics.FillEllipse(myLGBrush, 20, 150, 380, 50);
 }
Public Sub MultiplyTransformExample(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)

    ' Transform the LinearGradientBrush.
    Dim transformArray As Point() = {New Point(20, 150), _
    New Point(400, 150), New Point(20, 200)}
    Dim myMatrix As New Matrix(myRect, transformArray)
    myLGBrush.MultiplyTransform(myMatrix, MatrixOrder.Prepend)

    ' Draw a second ellipse to the screen using the transformed brush.
    e.Graphics.FillEllipse(myLGBrush, 20, 150, 380, 50)
End Sub

S’applique à

MultiplyTransform(Matrix)

Multiplie le Matrix qui représente la transformation géométrique locale de ce LinearGradientBrush par le Matrix spécifié en ajoutant au début le Matrix spécifié.Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix by prepending the specified 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)

Paramètres

matrix
Matrix

Matrix par lequel multiplier la transformation géométrique.The Matrix by which to multiply the geometric transform.

Exemples

Pour obtenir un exemple, consultez MultiplyTransform.For an example, see MultiplyTransform.

S’applique à