Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Where are classes for GIF, JPEG, PNG?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
I'm so happy! And I wish to make this tiny ad happy too:
The trailboss has a kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic