VB.NET - Animate GIF File Without Using Any Controls - Simple Code.
VB.NET - Animate GIF File Without Using Any Controls - Simple Code.
Rate VB.NET - Animate GIF File Without Using Any Controls - Simple Code.
(1(1 Vote))
Private animatedImage As New Bitmap("c:\gif4.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 Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
AnimateImage()
ImageAnimator.UpdateFrames()
e.Graphics.DrawImage(Me.animatedImage, New Point(50, 100))
End Sub
End Class
VB.NET - Animate GIF File Without Using Any Controls - Simple Code. Comments
No comments yet — be the first to post one!
Post a Comment