Is there any method I can use in order to know when animation1 has finished its very first loop?
I need to start animation2 only when I’m sure that animation1 has finished, (animation1 has 14 frames) can anyone provide me with a suggestion?
Thanks Andy
This is the code I have so far:
I need to start animation2 only when I’m sure that animation1 has finished, (animation1 has 14 frames) can anyone provide me with a suggestion?
Thanks Andy
This is the code I have so far:
Code:
Private TankFillingLow As Bitmap
Private TankFillingLowPosition As Point
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TankFillingLow = New Bitmap("TankFillingLow.gif")
ImageAnimator.Animate(TankFillingLow, New EventHandler(AddressOf OnFrameChange))
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.DoubleBuffer Or ControlStyles.UserPaint, True)
End Sub
Private Sub OnFrameChange(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 MyBase.Paint
If Not TankFillingLow Is Nothing Then
ImageAnimator.UpdateFrames(TankFillingLow)
Dim TempTankFillingLow As New Bitmap(TankFillingLow, TankFillingLow.Width, TankFillingLow.Height)
TempTankFillingLow.MakeTransparent(TempTankFillingLow.GetPixel(0, 0))
e.Graphics.DrawImage(TempTankFillingLow, 748, 462)
TempTankFillingLow.Dispose()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ImageAnimator.StopAnimate(TankFillingLow, New EventHandler(AddressOf OnFrameChange))
End Sub