File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes width and height using image object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "width and height using image object" Watch "width and height using image object" New topic
Author

width and height using image object

vidyadhar Joshi
Greenhorn

Joined: Oct 15, 2002
Posts: 1
how to reterive width and height of a gif image using image object.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Did you happen to see the getWidth() and getHeight() methods on the Image class in the JavaDocs? They take an ImageObserver as a parameter, but all Components are ImageObservers, so you usually have no problem passing a parameter in. Usually it's a good idea to run your Image through a MediaTracker to make sure it's loaded before trying to get information from it...


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: width and height using image object
 
Similar Threads
enlarging image with a constant speed
how to get image widt h and height?
How to get Image Width and Height using Javascript
Reduce size of image
Image Dimensions