LinearGradientBrush.MultiplyTransform 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
藉由在前面加上指定的 Matrix,將表示這個 LinearGradientBrush 的局部幾何轉換的 Matrix 乘以指定的 Matrix。
多載
MultiplyTransform(Matrix, MatrixOrder) |
依據指定的順序,將表示這個 Matrix 之局部幾何轉換的 LinearGradientBrush 乘以指定的 Matrix。 |
MultiplyTransform(Matrix) |
藉由在前面加上指定的 Matrix,將表示這個 LinearGradientBrush 的局部幾何轉換的 Matrix 乘以指定的 Matrix。 |
MultiplyTransform(Matrix, MatrixOrder)
依據指定的順序,將表示這個 Matrix 之局部幾何轉換的 LinearGradientBrush 乘以指定的 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)
參數
- order
- MatrixOrder
MatrixOrder,指定兩個矩陣相乘所依據的順序。
範例
下列程式代碼範例是設計來搭配 Windows Forms 使用,而且需要 PaintEventArgse
事件OnPaint物件。 此程式碼會執行下列動作:
建立新的 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)
藉由在前面加上指定的 Matrix,將表示這個 LinearGradientBrush 的局部幾何轉換的 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 -> unit
Public Sub MultiplyTransform (matrix As Matrix)
參數
範例
如需範例,請參閱 MultiplyTransform。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應