LinearGradientBrush.MultiplyTransform 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将表示此 LinearGradientBrush 的局部几何转换的 Matrix 乘以指定 Matrix 前面指定 Matrix。
重载
| MultiplyTransform(Matrix, MatrixOrder) | 将表示此 LinearGradientBrush 的局部几何转换的 Matrix 乘以指定顺序的指定 Matrix。 | 
| MultiplyTransform(Matrix) | 将表示此 LinearGradientBrush 的局部几何转换的 Matrix 乘以指定 Matrix 前面指定 Matrix。 | 
MultiplyTransform(Matrix, MatrixOrder)
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
将表示此 LinearGradientBrush 的局部几何转换的 Matrix 乘以指定顺序的指定 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 -> unitPublic Sub MultiplyTransform (matrix As Matrix, order As MatrixOrder)参数
- order
- MatrixOrder
一个 MatrixOrder,指定将两个矩阵相乘的顺序。
示例
下面的代码示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgseOnPaint 事件对象。 该代码执行以下操作:
- 创建新的 LinearGradientBrush。 
- 使用此画笔将省略号绘制到屏幕。 
- 调用 MultiplyTransform 方法以转换 LinearGradientBrush。 
- 使用转换后的画笔将椭圆绘制到屏幕正下方的第一个椭圆。 
请注意,下椭圆以水平方向拉伸,并拉伸渐变以匹配新形状。
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
适用于
MultiplyTransform(Matrix)
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
- Source:
- LinearGradientBrush.cs
将表示此 LinearGradientBrush 的局部几何转换的 Matrix 乘以指定 Matrix 前面指定 Matrix。
public:
 void MultiplyTransform(System::Drawing::Drawing2D::Matrix ^ matrix);public void MultiplyTransform (System.Drawing.Drawing2D.Matrix matrix);member this.MultiplyTransform : System.Drawing.Drawing2D.Matrix -> unitPublic Sub MultiplyTransform (matrix As Matrix)参数
示例
有关示例,请参阅 MultiplyTransform。