GDI+ provides matrix transformation so that you can transform (rotate, scale, translate, and so on) the items you draw.
The Graphics class provides several methods to transform an image: RotateTransform, ScaleTransform, and TranslateTransform.
RotateTransform is a method of the Graphics class to apply rotate transformation to the image.
The following is the syntax of the RotateTransform method:
|
RotateTransform(ByVal angle As Single) or RotateTransform(ByVal angle As Single, ByVal order As System.Drawing.Drawing2D.MatrixOrder) |
The following code example demonstrates how to apply rotate transformation:
ScaleTransform is a method of the Graphics class that function to apply scale transformation to the image.
The following is the syntax of the ScaleTransform method:
|
ScaleTransform(ByVal sx As Single, ByVal sy As Single) or ScaleTransform(ByVal sx As Single, ByVal sy As Single, ByVal order As System.Drawing.Drawing2D.MatrixOrder) |
The following code example demonstrates how to apply scale transformation to an image:
TranslateTransform is a method of the Graphics class that function to change the origin of the coordinate system.
The following is the syntax of the TranslateTransform method:
|
TranslateTransform(ByVal dx As Single, ByVal dy As Single) or TranslateTransform(ByVal dx As Single, ByVal dy As Single, ByVal order As System.Drawing.Drawing2D.MatrixOrder) |
The following code example demonstrates how to apply translate transformation: