Pen::MultiplyTransform Method (Matrix^)
.NET Framework (current version)
Namespace:
System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
Return to top
Assembly: System.Drawing (in System.Drawing.dll)
This method prepends the multiplication matrix specified in the matrix parameter to the transformation matrix for the multiplication operation.
The following code example is designed for use with Windows Forms, and it requires PaintEventArgse, which is a parameter of the Paint event handler. The code performs the following actions:
Creates a Pen.
Draws a line to the screen.
Multiplies the transformation matrix of the pen by the specified matrix.
Draws a line with the transformed pen.
public: void MultiplyTransform_Example1( PaintEventArgs^ e ) { // Create a Pen object. Pen^ myPen = gcnew Pen( Color::Black,5.0f ); // Create a translation matrix. Matrix^ penMatrix = gcnew Matrix; penMatrix->Scale( 3, 1 ); // Multiply the transformation matrix of myPen by transMatrix. myPen->MultiplyTransform( penMatrix ); // Draw a line to the screen. e->Graphics->DrawLine( myPen, 0, 0, 100, 100 ); }
.NET Framework
Available since 1.1
Available since 1.1
Show: