Computer Science Canada

Animated GIFs

Author:  Kid_Goron [ Thu May 26, 2005 8:29 am ]
Post subject:  Animated GIFs

I've been using animated gif in my final project in Java to increase the effect of the graphics. The problem is that it only load all the frames if the animated gif is a looped animation. I am using a frame and I am trying to load the animation for a bomb. I have gave the program a frame counter to count the number of frames the animated gif cycles through. After a certain number of frames for the animation have been loaded I send an int variable to stop the drawing the bombing. The problem is that even if I do not actually draw the image if continues to count the frames therefore, sometimes when I give a command to draw the animation it loads the animation wherever the frame counting left off (draws the animation not always from the beginning). I need some sort of way to completely kill the image so that I can reload it from the beginning. I've tried replacing the pic with another and assigning the pic variable a null, neither work. There is my program located below.


: