By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,642 Members | 2,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,642 IT Pros & Developers. It's quick & easy.

Animated GIG in VB6

P: 9
How to get an animated GIF to function in V6

I have an animated dove that was too lazy to flap his wing when flying across the screen. Of course VB6 doesn't see animated GIF's, so got this one figured out by extracting the 15 individual GIF pictures and using the following routine he does fly across as I want him to do.

The trick is to save each picture as a "transparent" picture.

Option Explicit

Private Sub Timer3_Timer()
picAnimate.Top = 1 'set location from top of screen

'Static variables keep there value with each procedure call
Static currentpic As Integer

'Determines if the animation is at the last picture and starts
'at the beginning if so
If currentpic = 14 Then currentpic = -1

'moves to the next picture
currentpic = currentpic + 1

'moves the picture to the left
picAnimate.Left = picAnimate.Left + 55 'orig setting 400

'determines if image is off screen
'-3600's causes a slight delay in the animation coming back around
If (picAnimate.Left) > ScaleWidth Then picAnimate.Left = -1000 ' orig -3600

'changes the image to the new image
picAnimate.Picture = imgDove(currentpic).Picture

End Sub


Hope someone can use this
[mail id removed]
Nov 24 '07 #1
Share this Question
Share on Google+
3 Replies


lotus18
100+
P: 866
vb 6 cannot handle gif animation but in vb .net it can. You need an active x control for running gif files in vb 6.

click this link http://www.thescripts.com/forum/thre...animation.html
Nov 24 '07 #2

Mohan Krishna
100+
P: 115
Hi everyone!
I tried in an different manner to animate, by getting some idea and some code from other sources.
But I don't know how to add the zip file here.
Nov 24 '07 #3

Mohan Krishna
100+
P: 115
Hi everyone!
I tried in an different manner to animate, by getting some idea and some code from other sources.
Now I could manage to attach. My Project's ZIP is attached...
Attached Files
File Type: zip AnimExample.zip (6.2 KB, 246 views)
Nov 24 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.