# VBForums CodeBank > CodeBank - Visual Basic 6 and earlier >  VB GIF Animator

## moeur

Here is Version 2 of the GFI animator.
The main changes are 
Truly transparentsupports more GIFsCan load gif from file or resourcebased on a class that can be used separately from the controlHere is how to use it

```
With ctlGIF1
    'hide border
    .BorderStyle = vbBSNone
    'make control size of picture
    .AutoSize = True
    'make transparent
    .BackStyle = ucTransparent
    'load gif from resource file
    .LoadGIF LoadResData(102, "CUSTOM")
    'Start the animation
    .Animate = True
End With
```

Try it out an let me know if there are GIFs it won't load or other bugs.
I know of one bug, but I'm working on that.

Here is the latest version which is down lower in this thread
http://www.vbforums.com/attachment.p...chmentid=40429

----------


## manavo11

The attachment seems to be missing  :Smilie:

----------


## moeur

> The attachment seems to be missing


I hate it when that happens.  :Blush:

----------


## moeur

New improved version uploaded today.
I think I fixed all the bugs, but you never know.

----------


## moeur

I uploaded a new version of the GIF animator.
I totally redesigned the class so that it is much more useful.
One problem that exists is that with a certain type of animated gif you will not get a transparent background.  This is because some GIFs use a mask to facilitate the transparency which is imbedded in the gif encoding.  I don't venture into the encoded image data instead I cheat and use the VB LoadPicture function.  LoadPicture handles the masked GIFs OK, but TransparentBLT and the stdPicture object cannot.

Take a look at the demo, it uses the control to anmate a helicopter that flies around the form and the class to animate a picture on a Command Button as well as a group of animated smilies.

This code is an improvement on the ANIGIF control that is sold online because it has a true background transparancy (i.e. the helicopter) and handles a type if GIF that ANIGIF cannot (again the helicopter).

----------


## piscis

Could someone please explain how to use this class in Visual Basic 2005? All the icons shown are unrecognized by my PC. Is this VB6?

Do I have to create a project and make references or do I insert?

----------


## JensPeder

Nothing else to say 'cept for: Great job!

----------


## Astro_4

I reckon this is the ****   :Thumb:   :big yellow:  its great

----------


## cyber_alex

I'll test this stuff tomorrow...seems really great!

----------


## ididntdoit

> Could someone please explain how to use this class in Visual Basic 2005? All the icons shown are unrecognized by my PC. Is this VB6?
> 
> Do I have to create a project and make references or do I insert?



This is vb6 code, as far as i know, your ****ed code wise, unles you got a text version of the code

----------


## msayed2004

Is it possible to add paintpicture function to such control , so we can zoom , rotate & resize GIFs

----------


## tcurrier

When I try to run this, I get:


VB Code:
ctlGIF.Animate = True

*Method or data member not found....*

When I unzip the files, do they all go into the same folder ?

----------


## winboss_cz

Wow, it's great! Thank you for this component.

----------


## joaquim

> I uploaded a new version of the GIF animator.
> I totally redesigned the class so that it is much more useful.
> One problem that exists is that with a certain type of animated gif you will not get a transparent background.  This is because some GIFs use a mask to facilitate the transparency which is imbedded in the gif encoding.  I don't venture into the encoded image data instead I cheat and use the VB LoadPicture function.  LoadPicture handles the masked GIFs OK, but TransparentBLT and the stdPicture object cannot.
> 
> Take a look at the demo, it uses the control to anmate a helicopter that flies around the form and the class to animate a picture on a Command Button as well as a group of animated smilies.
> 
> This code is an improvement on the ANIGIF control that is sold online because it has a true background transparancy (i.e. the helicopter) and handles a type if GIF that ANIGIF cannot (again the helicopter).


your object it's very good.... but can you give a toturial that tell me how read the subimages and put them in variable?
i just need the subimages... the transparency and effects i can do...
thank you

----------


## mustiback

Thanks For Share. i Finding This  :Smilie: )

----------


## okosv

Thanks! :-)

----------


## nemisha_s

Dude its really cool but how do I use it to put my own animations?  :Cry:  I'm trying to make a simple gif animation thing and its driving me crazy.  :Sick:

----------


## PinoyAko

Thanks for your class!

----------


## jmsrickland

I have seen this method 100's of times on the Net so either everyone just happens to have the same idea or everyone is copying everyone else.

I wish for once someone would learn how to decode the LZW and make a real Gif Animator instead of taking an existing GIF, breaking it into it's various frames, then combing them back and displaying each reconstructed frame.

----------


## masder

Hey ! Thanks for your class! Only one question! It is possible to load the recorce from a ImageList! Because if i delete de file the picture won't load  :Big Grin:  Thanks

----------

