|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.twelvemonkeys.image.GraphicsUtil
public final class GraphicsUtil
GraphicsUtil
| Constructor Summary | |
|---|---|
GraphicsUtil()
|
|
| Method Summary | |
|---|---|
static void |
enableAA(Graphics pGraphics)
Enables anti-aliasing in the Graphics object. |
static void |
setAlpha(Graphics pGraphics,
float pAlpha)
Sets the alpha in the Graphics object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GraphicsUtil()
| Method Detail |
|---|
public static void enableAA(Graphics pGraphics)
Graphics object.
Anti-aliasing is enabled by casting to Graphics2D and setting
the rendering hint RenderingHints.KEY_ANTIALIASING to
RenderingHints.VALUE_ANTIALIAS_ON.
pGraphics - the graphics object
ClassCastException - if pGraphics is not an instance of
Graphics2D.RenderingHints.KEY_ANTIALIASING
public static void setAlpha(Graphics pGraphics,
float pAlpha)
Graphics object.
Alpha is set by casting to Graphics2D and setting the composite
to the rule AlphaComposite.SRC_OVER multiplied by the given
alpha.
pGraphics - the graphics objectpAlpha - the alpha level, alpha must be a floating point
number in the inclusive range [0.0, 1.0].
ClassCastException - if pGraphics is not an instance of
Graphics2D.AlphaComposite.SRC_OVER,
AlphaComposite.getInstance(int, float)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||