LinearGradientBrush.MultiplyTransform Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Умножает объект 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 и требуется PaintEventArgs e
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.