PDA

View Full Version : Displaying a GIF in Java.



sean
11-22-2002, 06:08 PM
I recall posting a thread like this a few days ago but I searched and couldn't find it anywhere, so I"m just assuming there was an error and it never got processed.

This is for my NASA game. Could someone tell me what function to use for displaying animated GIFs in a Java applet? If you could name the function I should be able to find the documentation at Sun's Java website, but I search that for "GIF" and couldn't find anything. Thanks in advance if you can help.

Waldo2k2
11-22-2002, 06:14 PM
i think i said somethign the last time about trying www.codeguru.com/forum

but i'm not a java programmer so beyond that i can't help you much but....

if you've found a program that uses gifs, get a java class decompiler and you can figure out how to do it.

Mister C
11-22-2002, 06:22 PM
You can do this - however it is something 'beginners' don't usually do.

I could tell you but- go to www.javaranch.com and their boards and probably someone with more time could help you out.

sean
11-24-2002, 11:30 AM
Alright - I looked up the subject at JavaRanch, and I found out how to display the GIF. The problem however, is that if you're displaying an animated GIF, all the user sees is the first frames - apparently it happens to everything when the applet gets serialized. The only thing I need to animate however, would be a little rectangular window. It wouldn't even need to be animated. I just need it to show sections of a blue circle, and then turn red. I was thinking I could draw the shape where I wanted it, and then place everything else but the window around it, so all you'd see is what you'd see through the window. The only thing I need to learn how to do is, get this transparent section in the original picture. Can I just use transparent colors or is there something else I need to do?

Waldo2k2
11-24-2002, 11:33 AM
i really don't know how many people here are good at java, i know im' not, and mister c was the only other who replied, you'd probably get a quick answer here:
http://www.codeguru.com/forum/forumdisplay.php?forumid=5

good luck