hexIT
Class ImageTools

java.lang.Object
  extended byhexIT.ImageTools

public class ImageTools
extends java.lang.Object

ImageTools is a helper class that provides convenient methods for loading, caching, and scaling images.


Constructor Summary
ImageTools()
           
 
Method Summary
static java.awt.Image loadImage(java.lang.String filename)
          Load the image with the specified filename and return it.
static java.awt.Image loadScaledImage(java.lang.String filename, int new_width, int new_height)
          Scale the specified image.
static java.awt.Image scaleImage(java.awt.Image img, int new_width, int new_height)
          Scale the specified image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageTools

public ImageTools()
Method Detail

loadImage

public static java.awt.Image loadImage(java.lang.String filename)
Load the image with the specified filename and return it. Note, this image is then cached in an image cache. Subsequent calls to this method will return the cached image. If the file changes and an image with the same name is loaded, this will not work.


scaleImage

public static java.awt.Image scaleImage(java.awt.Image img,
                                        int new_width,
                                        int new_height)
Scale the specified image. This uses the default scaling algorithm. For more scaling functionality, see Image.getScaledInstance();


loadScaledImage

public static java.awt.Image loadScaledImage(java.lang.String filename,
                                             int new_width,
                                             int new_height)
Scale the specified image. If it is cached, the cached copy is used. This uses the default scaling algorithm. For more scaling functionality, see Image.getScaledInstance();