'Declarations
No declarations
'Code:
Public Class Form1
Private animatedImage As New Bitmap("c:\an90_e0.gif")
Private currentlyAnimating As Boolean = False
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AnimateImage()
End Sub
Private Sub AnimateImage()
If Not currentlyAnimating Then
ImageAnimator.Animate(animatedImage, _
New EventHandler(AddressOf Me.OnFrameChanged))
currentlyAnimating = True
End If
End Sub
Private Sub OnFrameChanged(ByVal Sender As Object, ByVal e As EventArgs)
Me.Invalidate()
End Sub
Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
AnimateImage()
ImageAnimator.UpdateFrames()
e.Graphics.DrawImage(Me.animatedImage, New Point(50, 100))
End Sub
End Class
Comments
Post a Comment