Animated GIG in VB6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • larystoy
    New Member
    • Nov 2007
    • 9

    Animated GIG in VB6

    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 "transparen t" 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.Lef t) > ScaleWidth Then picAnimate.Left = -1000 ' orig -3600

    'changes the image to the new image
    picAnimate.Pict ure = imgDove(current pic).Picture

    End Sub


    Hope someone can use this
    [mail id removed]
    Last edited by debasisdas; Nov 24 '07, 05:09 AM. Reason: Removed mail id
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    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
    Last edited by debasisdas; Nov 24 '07, 05:13 AM. Reason: Removed Excess Quote

    Comment

    • Mohan Krishna
      New Member
      • Oct 2007
      • 115

      #3
      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.

      Comment

      • Mohan Krishna
        New Member
        • Oct 2007
        • 115

        #4
        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
        Last edited by Mohan Krishna; Nov 24 '07, 05:04 AM. Reason: to add attachment

        Comment

        Working...