org.jhotdraw.util
Class Images

java.lang.Object
  extended by org.jhotdraw.util.Images

public class Images
extends java.lang.Object

Image processing methods.

Version:
$Id: Images.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer

Constructor Summary
private Images()
          Prevent instance creation.
 
Method Summary
static java.awt.Image createImage(java.lang.Class baseClass, java.lang.String resourceName)
           
static java.awt.Image createImage(java.net.URL resource)
           
static boolean hasAlpha(java.awt.Image image)
          This method returns true if the specified image has transparent pixels Code taken from the Java Developers Almanac 1.4 http://javaalmanac.com/egs/java.awt.image/HasAlpha.html
static java.awt.image.BufferedImage[] split(java.awt.Image image, int count, boolean isHorizontal)
          Splits an image into count subimages.
static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)
           
static java.awt.image.BufferedImage toBufferedImage(java.awt.image.RenderedImage rImg)
          Converts an Image to BufferedImage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Images

private Images()
Prevent instance creation.

Method Detail

createImage

public static java.awt.Image createImage(java.lang.Class baseClass,
                                         java.lang.String resourceName)

createImage

public static java.awt.Image createImage(java.net.URL resource)

toBufferedImage

public static java.awt.image.BufferedImage toBufferedImage(java.awt.image.RenderedImage rImg)
Converts an Image to BufferedImage. If the Image is already a BufferedImage, the same image is returned.

Parameters:
rImg - An Image.
Returns:
A BufferedImage.

toBufferedImage

public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)

hasAlpha

public static boolean hasAlpha(java.awt.Image image)
This method returns true if the specified image has transparent pixels Code taken from the Java Developers Almanac 1.4 http://javaalmanac.com/egs/java.awt.image/HasAlpha.html


split

public static java.awt.image.BufferedImage[] split(java.awt.Image image,
                                                   int count,
                                                   boolean isHorizontal)
Splits an image into count subimages.