Package com.twelvemonkeys.image
Class GraphicsUtil
java.lang.Object
com.twelvemonkeys.image.GraphicsUtil
GraphicsUtil
- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/image/GraphicsUtil.java#1 $
- Author:
- Harald Kuhr, last modified by $Author: haku $
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GraphicsUtil
public GraphicsUtil()
-
-
Method Details
-
enableAA
Enables anti-aliasing in theGraphics
object.Anti-aliasing is enabled by casting to
Graphics2D
and setting the rendering hintRenderingHints.KEY_ANTIALIASING
toRenderingHints.VALUE_ANTIALIAS_ON
.- Parameters:
pGraphics
- the graphics object- Throws:
ClassCastException
- ifpGraphics
is not an instance ofGraphics2D
.- See Also:
-
setAlpha
Sets the alpha in theGraphics
object.Alpha is set by casting to
Graphics2D
and setting the composite to the ruleAlphaComposite.SRC_OVER
multiplied by the given alpha.- Parameters:
pGraphics
- the graphics objectpAlpha
- the alpha level,alpha
must be a floating point number in the inclusive range [0.0, 1.0].- Throws:
ClassCastException
- ifpGraphics
is not an instance ofGraphics2D
.- See Also:
-