B
Ben Phillips
I'm once again tangled in the thickets of Image/ImageIO documentation
unable to get a fairly simple piece of information.
I can display an animated .gif easily enough, simply by implementing
ImageObserver with a JLabel subclass and having it repaint itself
whenever the ImageObserver sees something changed, and then feeding it
an animated .gif through loadResource or similar.
What I can't seem to do is implement any of the following to the obvious
spec:
public static boolean isAnimatedGif (Image image);
public static boolean isAnimatedGif (File file);
public static boolean isAnimatedGid (URL url);
and ImageIO seems to produce a static BufferedImage of just one frame
from the things.
The minimum I need here is some sort of "isAnimatedGif" method
implementation that will work, or a pointer into the right bit of
API/right third-party library to get me going on doing that bit myself.
FWIW, a google search for "java animated gif" turned up several
references to the ImageObserver trick and nothing else of note.
unable to get a fairly simple piece of information.
I can display an animated .gif easily enough, simply by implementing
ImageObserver with a JLabel subclass and having it repaint itself
whenever the ImageObserver sees something changed, and then feeding it
an animated .gif through loadResource or similar.
What I can't seem to do is implement any of the following to the obvious
spec:
public static boolean isAnimatedGif (Image image);
public static boolean isAnimatedGif (File file);
public static boolean isAnimatedGid (URL url);
and ImageIO seems to produce a static BufferedImage of just one frame
from the things.
The minimum I need here is some sort of "isAnimatedGif" method
implementation that will work, or a pointer into the right bit of
API/right third-party library to get me going on doing that bit myself.
FWIW, a google search for "java animated gif" turned up several
references to the ImageObserver trick and nothing else of note.