Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
public class RotateTransformWithMatrixOrderPrepend
public Shared Sub Main
Application.Run(New Form1)
End Sub
End class
public class Form1
Inherits System.Windows.Forms.Form
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
e.Graphics.ScaleTransform(90, 90, MatrixOrder.Append)
e.Graphics.TranslateTransform( _
Me.ClientRectangle.Width \ 2, _
Me.ClientRectangle.Height \ 2, _
MatrixOrder.Append)
For i As Integer = 5 To 90 Step 5
e.Graphics.RotateTransform(5, MatrixOrder.Prepend)
e.Graphics.DrawRectangle(New Pen(Color.Black, 0), -1, -1, 2, 2)
Next i
End Sub
Public Sub New()
MyBase.New()
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
End Sub
End Class
|