Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2003

Tip: Looking for answers? Try searching our database.

image object width and height

Thread view: 
lagging indicator - 23 Dec 2003 15:50 GMT
Hi all,
I am wondering if there's a wiser way to get the image object's width and
height, please advise.
Here is my idea:

new ImageIcon(image_object).getIconWidth();
new ImageIcon(image_object).getIconHeight();
VisionSet - 23 Dec 2003 18:09 GMT
> Hi all,
> I am wondering if there's a wiser way to get the image object's width and
[quoted text clipped - 3 lines]
> new ImageIcon(image_object).getIconWidth();
> new ImageIcon(image_object).getIconHeight();

If you mean wiser in the sense that you don't need to load the image into
memory.
Then yes, if that is all you need to do then use the ImageIO package

specifically You need an ImageReader for the image format you have:

javax.imageio.ImageIO.getImageReadersByFormatName(String formatName)

and then you use the two methods:

javax.imageio.ImageReader.getHeight()
javax.imageio.ImageReader.getWidth()

These will read only as much of the file as is necessary to determine these
attributes.

Signature

Mike W

ak - 23 Dec 2003 22:09 GMT
http://reader.imagero.com
Andrew Thompson - 23 Dec 2003 22:46 GMT
> Hi all,
> I am wondering if there's a wiser way to get the image object's width and
> height, please advise.

http://www.geocities.com/marcoschmidt.geo/image-info.html

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.