I have a partly developed game with some cheesy animations where I converted some lo-res trial images from scratch. I'd like to display some decent animations. I have MacroMedia Dreamweaver 4 Fireworks 4 Studio, and the Fireworks uses PNG as its native format. Probably I could also convert some animations or find a tool to make GIF animations. All I have found in the various O'Reilly and other books on AWT, Swing, How-To... is stuff about manipulating basic Java images. How do I get a PNG or GIF, or at least a cell, into an image? As in, where is a class to save me all the work?
Scott, You have to use either getImage(URL url, String filename) in the Applet class, or use getImage(String filename) in the Toolkit class (which you can use by using the static method Toolkit.getDefaultToolkit()) The current Java 1.3 specs for the toolkit version specificly says it can read image info from a GIF, JPG, or PNG image, I would assume that the new 1.3 Applet version does the same thing, but just to be safe I would stick to reading GIF or JPG images since they have been with Java from the beginning... especially if you are going to be making an applet... those browser JVMs are sucky and old, and don't support PNG. HTH, -Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I'm so happy! And I wish to make this tiny ad happy too: