Click to See Complete Forum and Search --> : Animating GIFs
Stoopy
Mar 21st, 2001, 09:51 AM
I am working on a project in my computer progamming class and I want to put GIFs on the forms. What is the code or the procedure to get them to animate correctly?
oBiOnE
Mar 21st, 2001, 10:04 AM
Join the club, there is code on the VB-World sitee showing it, but it is long and requires multiple instances of the image.
Does anyone know of an OCX that supports animated GIF's?
Stoopy
Mar 21st, 2001, 10:12 AM
Where can I find this code on the site?
MR BIG ov HDC
Mar 22nd, 2001, 04:11 AM
http://acky.net/vb/vbgraph/
Download an OCX (Unregistered) from here. Public URL.
Stoopy
Mar 22nd, 2001, 09:39 AM
It is a cool program and it works, but how do I apply it to my program? Really new at this.
MR BIG ov HDC
Mar 22nd, 2001, 11:04 AM
Hi Stoopy.
Nice to hear from you. The answer to your question is simple, but I have to know if your using VB6.
Firstly, let me give you a little tutorial.
OCX files are termed "ActiveX Controls", and are Microsoft(C) (Cant forget to do that!) -'s answer to reusable objects. What are reusable objects? I hear you ask?, well ...
An Object to which I am referring could be a form, Textbox, Label, Chicken Curry or anything else you can place on a form. In fact, the form itself is an object.
Objects have Properties and Methods, we will discuss this a little further later).
1. The Object which you downloaded (The OCX file), must be resident in your Windows system directory (Win NT - C:\Winnt\System32 or Win 98 - C:\Windows\System). Make sure that the OCX control is copied into this directory first.
2. Now you must register the control :
If Win NT machine :
select START from the windows toolbar
select RUN
enter : C:\WINNT\System32\regsvr32.exe C:\Winnt\System32\anigif.ocx
You should now get a message, something to the extent of : anigif.ocx registration suceeded
(something like that). This means that it is now available to use in VB. When you tested the file earlier (before I sent you this email), the above was automatically done. It is, however very important that you know the preceeding process.
3. Open Your Project - heres the good bit
4. In the "Projects" menu, select "Components". You should be able to see "Animation GIF OLE CONTROL". Tick this box.
5. In your toolbox on the screen, you should see a new icon appear. This is the Animation Gif control/object that you are going to use to create the animation.
6. You must add the control to the form. Select the control from the form and use it like you would any other control - ie click on a form and drag-open the gif control - will be flat and greyyed as there is nothing in it at the moment.
7. Now go down to the Properties section and select "GIF". Next to this will be a "(none)" thingy. You have to select this "(None)" until a small box "..." appears. Click this button and a file selection box will appear. Select your gif file here (should be easy enough to follow), and voila!!!
One VERY important point to make is once you have the Gif in the project, if you are going to show this project to a teacher, Make sure it all works fine by testing it on another computer. Also, if your going to use this control in any commercial stuff of your own, please abide by the Licencing on the product - all programmers have to earn a crust somehow.
For further information, let me know.
Regards
Mister BIG.
MR BIG ov HDC
Mar 22nd, 2001, 11:18 AM
Hi Stoopy.
I forgot, in your code you must use AniGIF1.Play at the point that you want it to animate, or it will just display the initial gif (unanimated). I would suggest doing this in the Form.Load Procedure, but you can put it anywhere you wish - its your project
Regards,
Mr BIG.
kumkalk
Mar 22nd, 2001, 11:13 PM
You cannot animate a gif inside the formusing image or picture control.
For that you must first covert the gif file into an Avi file using Animation shop or Corel Photopaint softwares and after that make use of Animation control in (Windows common controls) in the components bar in project menu.
And place that animation control in the form and give
Animation1.open "C:\Kumar\Zingi.avi"
and don;t forget to set Animation1.Autoplay = True
like this in your coding.
You will be amazing to see the animation on your form.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.