public abstract class GraphicsUtils extends Object
Modifier | Constructor and Description |
---|---|
protected |
GraphicsUtils()
Default constructor that prevents creation of class.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
hasAlpha(Image image)
This method returns
true if the specified image has the
possibility to store transparent pixels. |
static BufferedImage |
toBufferedImage(Image image)
This method returns a buffered image with the contents of an image.
|
static BufferedImage |
toBufferedImage(RenderedImage image)
Converts an arbitrary image to a
BufferedImage . |
static boolean |
usesAlpha(Image image)
This method returns
true if the specified image has at least one
pixel that is not fully opaque. |
protected GraphicsUtils()
public static boolean hasAlpha(Image image)
true
if the specified image has the
possibility to store transparent pixels.
Inspired by http://www.exampledepot.com/egs/java.awt.image/HasAlpha.htmlimage
- Image that should be checked for alpha channel.true
if the specified image can have transparent pixels,
false
otherwisepublic static boolean usesAlpha(Image image)
true
if the specified image has at least one
pixel that is not fully opaque.image
- Image that should be checked for non-opaque pixels.true
if the specified image has transparent pixels,
false
otherwisepublic static BufferedImage toBufferedImage(RenderedImage image)
BufferedImage
.image
- Image that should be converted.BufferedImage
.public static BufferedImage toBufferedImage(Image image)
image
- Image to be convertedCopyright © 2010-2013. All Rights Reserved.