sharkystar
26th October 2007 18:20 UTC
Loop an animated gif
Hi guys
I'm using AnimGif to display a gif on a custom page - no problems. I have a function to start and stop it.
However, could someone please tell me how to loop the animation as it just plays once then stops.
There doesn't seem to be any help in the plugin examples files.
Thanks
kichik
26th October 2007 19:01 UTC
From AnimGIF's description, it sounds like it should display the GIF in an infinite loop until you stop it. Are you sure the GIF itself is built this way? What happens when you display it in a browser?
sharkystar
26th October 2007 23:09 UTC
That's a really good point kichik, and no I hadn't even tested that. However the gif does actually loop in a browser, so I'm still stumped as to how we loop an animated gif.
Anyone.....??
pospec
27th October 2007 11:27 UTC
Show me that gif
CancerFace
28th October 2007 13:33 UTC
If I remember correctly there should be a 'loop' flag in the header of the GIF file itself, which turns it on/off. You could try using something like GIF Construction Set to set the loop flag.
CF
[Edit] Oups, just saw the second post ... My bad, I didn't realize that it does loop in a browser. The only other thing I can suggest is to check the number of iterations set for the animation, it may be that the plugin does not like both the loop flag on and a number of iterations >0 ?
Takhir
29th October 2007 07:18 UTC
Looks like plug-in not extracts 'loops' parameter from GIF header. For now just add at the end of play() function in the animgif.cpp file (line ~246):
lpWndProcOld = (void *)SetWindowLong(childwnd, GWL_WNDPROC, (long)WndProc);
+ imgset.nLoops = 1;
anim.Play (childwnd, r, &imgset, trCol);