com.adobe.idml
Class ImageUtils

java.lang.Object
  extended by com.adobe.idml.ImageUtils

public abstract class ImageUtils
extends java.lang.Object

This class contains utilities related to viewing images in a Java graphical interface.


Constructor Summary
ImageUtils()
           
 
Method Summary
static javax.swing.ImageIcon getScaledImageIcon(int width, int height, java.io.File imgFile)
          Given an image file and the required dimensions, this method will return a scaled ImageIcon object for the image file provided.
static boolean isSupportedByImageIO(java.lang.String imgPath)
          Determines if the file type of the image is supported by this utility.
static java.awt.image.BufferedImage scaleImage(java.awt.image.BufferedImage img, int width, int height)
          Scales a BufferedImage object to the size requested.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtils

public ImageUtils()
Method Detail

getScaledImageIcon

public static javax.swing.ImageIcon getScaledImageIcon(int width,
                                                       int height,
                                                       java.io.File imgFile)
                                                throws java.io.IOException,
                                                       PackageException
Given an image file and the required dimensions, this method will return a scaled ImageIcon object for the image file provided.

Parameters:
width - The requested width for the image.
height - The requested height for the image.
imgFile - The image file to generated an ImageIcon object from.
Returns:
A scaled ImageIcon object for the image file provided.
Throws:
java.io.IOException
PackageException

scaleImage

public static java.awt.image.BufferedImage scaleImage(java.awt.image.BufferedImage img,
                                                      int width,
                                                      int height)
                                               throws java.io.IOException
Scales a BufferedImage object to the size requested.

Parameters:
img - The BufferedImage object to be scaled.
width - The width to scale the image to.
height - The height to scale the image to.
Returns:
Returns a BufferedImage object scaled to the width and height requested.
Throws:
java.io.IOException

isSupportedByImageIO

public static boolean isSupportedByImageIO(java.lang.String imgPath)
Determines if the file type of the image is supported by this utility.

Parameters:
imgPath - The path the the image file to be tested.
Returns:
Returns true if the file type of the image is supported by this utility and false if not.


Copyright © 2008 Adobe Systems Incorporated. All Rights Reserved.