All Packages Class Hierarchy This Package Previous Next Index
Class datarep.common.ImageHandler
java.lang.Object
|
+----datarep.common.ImageHandler
- public class ImageHandler
- extends Object
The ImageHandler class handles the loading and scaling of images.
- Version:
- 1.2
- Author:
- Data Representations, Inc.
-
ImageHandler(File, Component)
-
-
ImageHandler(Image, Component)
-
-
ImageHandler(String, Component)
- Creates a new ImageHandler.
-
ImageHandler(String, String, Component)
- Creates a new ImageHandler, with the image specified by the directory and the (file)name, and
using the component specified by comp.
-
ImageHandler(URL, Component)
-
-
crop(int, int, int, int)
-
-
crop(Rectangle)
- returns a new imagehandler for the current image, but cropped to the given Rectangle.
-
getHeight()
-
-
getImage()
-
-
getScalingType()
- gets the type of scaling
-
getSize()
-
-
getWidth()
-
-
gray()
-
-
gray(boolean, int)
- returns a new imageHandler for the current image, but with a percent gray and brightness
as specified.
-
scale(Dimension)
- Returns a new imagehandler for the current image, but scaled to the given dimension.
-
scale(int, int)
-
-
setScalingType(int)
- Sets the scaling type for the imageHandler.
ImageHandler
public ImageHandler(Image original,
Component comp)
ImageHandler
public ImageHandler(String dir,
String name,
Component comp)
- Creates a new ImageHandler, with the image specified by the directory and the (file)name, and
using the component specified by comp.
ImageHandler
public ImageHandler(String name,
Component comp)
- Creates a new ImageHandler. The string "name" can either be a URL or a more traditional
file name which specifies the location of the desired image.
ImageHandler
public ImageHandler(File file,
Component comp)
ImageHandler
public ImageHandler(URL url,
Component comp)
setScalingType
public ImageHandler setScalingType(int scalingType)
- Sets the scaling type for the imageHandler.
The options are
- Image.SCALE_DEFAULT
- Image.SCALE_FAST
- Image.SCALE_SMOOTH
- Image.SCALE_REPLICATE
- Image.SCALE_AREA_AVERAGING
getScalingType
public int getScalingType()
- gets the type of scaling
getImage
public Image getImage()
getWidth
public int getWidth()
getHeight
public int getHeight()
getSize
public Dimension getSize()
scale
public ImageHandler scale(Dimension d)
- Returns a new imagehandler for the current image, but scaled to the given dimension.
- Returns:
- a new ImageHandler scaled to the given Dimension.
scale
public ImageHandler scale(int width,
int height)
crop
public ImageHandler crop(Rectangle r)
- returns a new imagehandler for the current image, but cropped to the given Rectangle.
crop
public ImageHandler crop(int x,
int y,
int width,
int height)
gray
public ImageHandler gray()
gray
public ImageHandler gray(boolean brighter,
int percent)
- returns a new imageHandler for the current image, but with a percent gray and brightness
as specified.
All Packages Class Hierarchy This Package Previous Next Index