Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

animated gif

Status
Not open for further replies.

borsker

Programmer
Jul 24, 2002
147
0
0
US
I never tried to use an animated gif before, so now i am paying the price. I am trying to add an animated gif to a form. I do not even know where to start. I tried looking online or even a few posts with little success. Can anyone point me in the right direction.
 
You don't say what version of VFP you are using, but in the latest version animated gif support is provided for the image control. Throw an image control on your form, set the picture property to your animated gif, then run the form...

Code:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	Name = "form1"

	ADD OBJECT image1 AS image WITH ;
		Picture = (home(4) + "\gifs\morphfox.gif"), ;
		Height = 120, ;
		Left = 129, ;
		Top = 65, ;
		Width = 116, ;
		Name = "Image1"

ENDDEFINE

boyd.gif

SweetPotato Software Website
My Blog
 
sorry about that, i am useing the old 6.0 version. I tried your code but the image came in blank
 
To do it with VFP 6 you need to add an ole animation control to your form, then use this code to play it:
Code:
WITH THISFORM.oleAnimControl
    .Open("SomeAVIFile.AVI")
    .Play()
ENDWITH
And this code to stop it:
Code:
THISFORM.oleAnimControl.Close

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Hi there,
if you dont want or cannot upgrade to VFP8 or even better 9,
you could consider to search the internet for gif2avi and download a transformer in order to enable you to apply a gif into your VFP6 application.
Jockey(2)
 
The best way to display an animated GIF pre-VFP8 was to use the web browser control. It certainly knows how to display animated gif's.
 
OK finally got vfp9 and trying the animation again with little success. i am creating the form with the form editor. it is to complex for me to build it with code. i am adding an image and i am selecting a gif but when i run the form the gif just freezes. no error just a solid image not a running animation. do i have to set the image up differently with the properties window or what?
 
borsker,

There is either something wrong with the animated gif or something in your code that is causing the problem. See if the animated gif will work with gif89.dll. This was the dll that I used prior to animated gif support being added to VFP. You can download it from...


boyd.gif

SweetPotato Software Website
My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top