Graphics.TranslateTransform Method (Single, Single)
Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.
Assembly: System.Drawing (in System.Drawing.dll)
The origin is typically the upper-left-hand corner of the drawing surface. The translation operation consists of multiplying the transformation matrix by a matrix whose translation part is the dx and dy parameters. This method applies the translation by prepending the translation matrix to the transformation matrix.
Rotates the world transformation matrix of the Windows Form by 30.0F degrees.
Moves the origin of the graphics object by calling, prepending the translation to the transformation matrix.
Draws a translated, rotated ellipse with a blue pen.
Private Sub TranslateTransformAngle(ByVal e As PaintEventArgs) ' Set world transform of graphics object to rotate. e.Graphics.RotateTransform(30.0F) ' Then to translate, prepending to world transform. e.Graphics.TranslateTransform(100.0F, 0.0F) ' Draw translated, rotated ellipse to screen. e.Graphics.DrawEllipse(New Pen(Color.Blue, 3), 0, 0, 200, 80) End Sub
The following illustration shows the output of running the previous code example.
Available since 1.1