File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes Reading .gif Images from a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading .gif Images from a file" Watch "Reading .gif Images from a file" New topic

Reading .gif Images from a file

Vanitha Sugumaran
Ranch Hand

Joined: Apr 11, 2001
Posts: 356
Can anyone give me idea how to read images from a file. To load the image in a frame we can use ToolKit, but I have to read the image. I read about JAI (Java Advanced Imaging), I am not sure about using it.
Shital Shisode

Joined: Nov 15, 2001
Posts: 7
Foll code is used to load an image from a file.
Image im = getToolkit().getImage("imgFile.gif");
Let me know if you need anything else.
Hope it helps !!

Vanitha Sugumaran
Ranch Hand

Joined: Apr 11, 2001
Posts: 356
Thanks for your reply. I have used Toolkit to load the image into the Frame. What I really want to know is how to get the details about the image, like getting the height, width.. of the image.
I agree. Here's the link:
subject: Reading .gif Images from a file
Similar Threads
executable jar file
Images in a JAR
getImage Problem
Java2D: byte[ ] from an Image
Write image to a file