Graphics.ScaleTransform Method (Single, Single, MatrixOrder)
Applies the specified scaling operation to the transformation matrix of this Graphics in the specified order.
Assembly: System.Drawing (in System.Drawing.dll)
Scale factor in the x direction.
Scale factor in the y direction.
The scaling operation consists of multiplying the transformation matrix by a diagonal matrix whose elements are (sx, sy, 1). This method prepends or appends the transformation matrix of the Graphics by the scaling matrix according to the order parameter.
Rotates the world transformation matrix of the Windows Form by 30 degrees.
Scales that matrix by a factor of 3 in the x direction and a factor of 1 in the y direction by appending the scaling transformation with the Append member.
Draws a rotated, scaled rectangle with a blue pen.
The result is a parallelogram.
Private Sub ScaleTransformFloatMatrixOrder(ByVal e As PaintEventArgs) ' Set world transform of graphics object to rotate. e.Graphics.RotateTransform(30.0F) ' Then to scale, appending to world transform. e.Graphics.ScaleTransform(3.0F, 1.0F, MatrixOrder.Append) ' Draw rotated, scaled rectangle to screen. e.Graphics.DrawRectangle(New Pen(Color.Blue, 3), 50, 0, 100, 40) End Sub
Available since 1.1