Bermain Animasi Dengan VB


 Dim FrameCount As Long

Private Sub Command1_Click()
  Timer1.Enabled = False
  If LoadGif(Text1, Image1) Then
     FrameCount = 0
     Timer1.Interval = CLng(Image1(0).Tag)
     Timer1.Enabled = True
  End If
End Sub

Private Sub Command2_Click()
   Timer1.Enabled = False
End Sub

Private Sub Command3_Click()
   Timer1.Enabled = True
End Sub

Private Sub Form_Load()

  Text1.Text = App.Path & IIf(Right(App.Path, 1) = “\”, “”, “\”) & “clip.gif”
  Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
    If FrameCount < TotalFrames Then
        Image1(FrameCount).Visible = False
        FrameCount = FrameCount + 1
        Image1(FrameCount).Visible = True
        Timer1.Interval = CLng(Image1(FrameCount).Tag)
    Else
        FrameCount = 0
        For i = 1 To Image1.Count – 1
            Image1(i).Visible = False
        Next i
        Image1(FrameCount).Visible = True
        Timer1.Interval = CLng(Image1(FrameCount).Tag)
    End If
End Sub

3 responses to “Bermain Animasi Dengan VB

  1. Iam Herry Oval my first name is Herry my last name is Oval my Hobby is Music and my favorite color is the cream

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s