net.sf.bt747.j2se.app.list
Class MyThumbNail
java.lang.Object
net.sf.bt747.j2se.app.list.MyThumbNail
public final class MyThumbNail
- extends java.lang.Object
Method Summary |
static java.awt.image.BufferedImage |
createThumbnail(java.awt.MediaTracker mt,
java.lang.String imgFilePath,
int thumbWidth,
int thumbHeight)
|
static java.awt.image.BufferedImage |
createThumbnailSanselan(java.awt.MediaTracker mt,
java.lang.String imgFilePath,
int thumbWidth,
int thumbHeight)
|
static java.awt.image.BufferedImage |
createThumbnailSingleStep(java.awt.MediaTracker mt,
java.lang.String imgFilePath,
int thumbWidth,
int thumbHeight)
|
static java.awt.image.BufferedImage |
getScaledInstanceMultiStep(java.awt.image.BufferedImage img,
int targetWidth,
int targetHeight,
java.lang.Object hint,
boolean higherQuality)
Convenience method that returns a scaled instance of the provided
BufferedImage . |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyThumbNail
public MyThumbNail()
createThumbnail
public static final java.awt.image.BufferedImage createThumbnail(java.awt.MediaTracker mt,
java.lang.String imgFilePath,
int thumbWidth,
int thumbHeight)
throws java.lang.Exception
- Throws:
java.lang.Exception
createThumbnailSingleStep
public static final java.awt.image.BufferedImage createThumbnailSingleStep(java.awt.MediaTracker mt,
java.lang.String imgFilePath,
int thumbWidth,
int thumbHeight)
throws java.lang.Exception
- Throws:
java.lang.Exception
getScaledInstanceMultiStep
public static java.awt.image.BufferedImage getScaledInstanceMultiStep(java.awt.image.BufferedImage img,
int targetWidth,
int targetHeight,
java.lang.Object hint,
boolean higherQuality)
- Convenience method that returns a scaled instance of the provided
BufferedImage
.
- Parameters:
img
- the original image to be scaledtargetWidth
- the desired width of the scaled instance, in pixelstargetHeight
- the desired height of the scaled instance, in pixelshint
- one of the rendering hints that corresponds to RenderingHints.KEY_INTERPOLATION
(e.g. RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
,
RenderingHints.VALUE_INTERPOLATION_BILINEAR
, RenderingHints.VALUE_INTERPOLATION_BICUBIC
)higherQuality
- if true, this method will use a multi-step scaling technique
that provides higher quality than the usual one-step
technique (only useful in downscaling cases, where targetWidth
or targetHeight
is smaller than the
original dimensions, and generally only when the BILINEAR
hint is specified)
- Returns:
- a scaled version of the original
BufferedImage
createThumbnailSanselan
public static final java.awt.image.BufferedImage createThumbnailSanselan(java.awt.MediaTracker mt,
java.lang.String imgFilePath,
int thumbWidth,
int thumbHeight)
throws java.lang.Exception
- Throws:
java.lang.Exception