Using images in a java app.
I want to create a Java app that will have a list of images that the user can click on, and it will then load that image and display it. The images may be different sizes, but i want the image to be confined within a specific space. I know how to keep the aspect ratio and set the image box and even center it in the container, but i cant seem to get ahold of the attributes that tell me what the height /width of the image is... Where/how do i find these out? Can anyone direct me towards a tutorial?
thanks
Hi,
I've extended the icon framework to support scaling. Maybe you find it useful (the library is open source):
Have a look a the JXIconLabel and the classes in the icon package.
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/JXIconLabel.html
http://softsmithy.sourceforge.net/lib/docs/api/org/softsmithy/lib/swing/icon/package-summary.html
Set the zooming strategy of the JXIconLabel to FullZooming.RESPECTING_ASPECT_RATIO_INSTANCE
Homepage:
http://www.softsmithy.org
Download:
http://sourceforge.net/project/showfiles.php?group_id=64833
Source:
http://sourceforge.net/svn/?group_id=64833
http://softsmithy.svn.sourceforge.net/viewvc/softsmithy/trunk/lib/src/org/softsmithy/lib/
-Puce
Pucea at 2007-7-12 19:55:16 >
