1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Public Class pivot
Dim imagetwo As Bitmap
Dim angle As Integer
Private Sub pivot_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SetStyle(ControlStyles.DoubleBuffer, True)
SetStyle(ControlStyles.AllPaintingInWmPaint, True)
imagetwo = New Bitmap("l11.jpg")
imagetwo.MakeTransparent(Color.Black)
gameloop.start()
End Sub
Private Sub pivot_paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
e.Graphics.TranslateTransform(90, 90)
e.Graphics.RotateTransform(angle)
e.Graphics.DrawImage(imagetwo, -30, -30, 60, 60)
e.Graphics.ResetTransform()
End Sub
Private Sub gameloop_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gameloop.Tick
angle += 0
Me.Refresh()
End Sub
End Class |
Partager