org.autoplot.pngwalk.ImageResize

first from http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html resize taken from http://www.componenthouse.com/article-20

ImageResize( )


logger


getScaledInstance

getScaledInstance( java.awt.image.BufferedImage img, int thumbSize ) → java.awt.image.BufferedImage

convenient typical use.

Parameters

img - image to resize.
thumbSize - corner-to-corner size, preserving aspect ratio.

Returns:

buffered image that is thumbSize across.

[search for examples] [view on GitHub] [view on old javadoc]


getScaledInstance

getScaledInstance( java.awt.image.BufferedImage img, int targetWidth, int targetHeight, Object hint, boolean higherQuality ) → java.awt.image.BufferedImage

Convenience method that returns a scaled instance of the provided BufferedImage.

Parameters

img - the original image to be scaled
targetWidth - the desired width of the scaled instance, in pixels
targetHeight - the desired height of the scaled instance, in pixels
hint - one of the rendering hints that corresponds to {@code RenderingHints.KEY_INTERPOLATION} (e.g. {@code RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR}, {@code RenderingHints.VALUE_INTERPOLATION_BILINEAR}, {@code 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 {@code targetWidth} or {@code targetHeight} is smaller than the original dimensions, and generally only when the {@code BILINEAR} hint is specified)

Returns:

a scaled version of the original {@code BufferedImage}

[search for examples] [view on GitHub] [view on old javadoc]