public abstract class GraphicsUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.awt.Shape |
clone(java.awt.Shape shape) |
static boolean |
equals(java.awt.Shape shapeA,
java.awt.Shape shapeB) |
static java.awt.image.BufferedImage |
getAlphaImage(java.awt.image.BufferedImage image) |
static java.awt.Font |
getPhysicalFont(java.awt.Font logicalFont) |
static java.awt.Font |
getPhysicalFont(java.awt.Font logicalFont,
java.lang.String testText)
Try to guess physical font from the properties of a logical font, like
"Dialog", "Serif", "Monospaced" etc.
|
static boolean |
hasAlpha(java.awt.Image image)
This method returns
true if the specified image has the
possibility to store transparent pixels. |
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.Image image)
This method returns a buffered image with the contents of an image.
|
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.image.RenderedImage image)
Converts a rendered image instance to a
BufferedImage. |
static boolean |
usesAlpha(java.awt.Image image)
This method returns
true if the specified image has at least one
pixel that is not fully opaque. |
public static boolean hasAlpha(java.awt.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(java.awt.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 java.awt.image.BufferedImage toBufferedImage(java.awt.image.RenderedImage image)
BufferedImage.image - Rendered image that should be converted.BufferedImage.public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)
image - Image to be convertedpublic static java.awt.Shape clone(java.awt.Shape shape)
public static java.awt.Font getPhysicalFont(java.awt.Font logicalFont,
java.lang.String testText)
logicalFont - Logical font object.testText - Text used to determine font properties.public static java.awt.Font getPhysicalFont(java.awt.Font logicalFont)
public static java.awt.image.BufferedImage getAlphaImage(java.awt.image.BufferedImage image)
public static boolean equals(java.awt.Shape shapeA,
java.awt.Shape shapeB)