edu.umd.cs.piccolox.util
Class ShadowUtils
java.lang.Object
edu.umd.cs.piccolox.util.ShadowUtils
public final class ShadowUtils
- extends Object
Static utility methods for creating shadows.
Method Summary |
static BufferedImage |
createShadow(Image src,
Paint shadowPaint,
int blurRadius)
Create and return a new buffered image containing a shadow of the specified source image
using the specifed shadow paint and gaussian blur radius. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
createShadow
public static BufferedImage createShadow(Image src,
Paint shadowPaint,
int blurRadius)
- Create and return a new buffered image containing a shadow of the specified source image
using the specifed shadow paint and gaussian blur radius. The dimensions of the returned image will be
src.getWidth() + 4 * blurRadius
x src.getHeight() + 4 * blurRadius
to account for blurring beyond the bounds of the source image. Thus the source image
will appear to be be offset by (2 * blurRadius
, 2 * blurRadius
)
in the returned image.
- Parameters:
src
- source image, must not be nullshadowPaint
- shadow paintblurRadius
- gaussian blur radius, must be > 0
- Returns:
- a new buffered image containing a shadow of the specified source image
using the specifed shadow paint and gaussian blur radius
Copyright © 1995-2011 Piccolo2D. All Rights Reserved.