Example usage for java.awt RenderingHints VALUE_ALPHA_INTERPOLATION_DEFAULT

List of usage examples for java.awt RenderingHints VALUE_ALPHA_INTERPOLATION_DEFAULT

Introduction

In this page you can find the example usage for java.awt RenderingHints VALUE_ALPHA_INTERPOLATION_DEFAULT.

Prototype

Object VALUE_ALPHA_INTERPOLATION_DEFAULT

To view the source code for java.awt RenderingHints VALUE_ALPHA_INTERPOLATION_DEFAULT.

Click Source Link

Document

Alpha interpolation hint value -- alpha blending algorithms are chosen by the implementation for a good tradeoff of performance vs.

Usage

From source file:com.igormaznitsa.jhexed.renders.svg.SVGImage.java

public void render(final Graphics2D g) throws IOException {
    final Object antialiasText = g.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
    final Object antialiasDraw = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
    final Object antialiasAlpha = g.getRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION);
    try {//from w ww  .  java 2 s  .com
        processAntialias(this.quality, g);
        this.svgGraphicsNode.primitivePaint(g);
    } finally {
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                antialiasText == null ? RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT : antialiasText);
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                antialiasDraw == null ? RenderingHints.VALUE_ANTIALIAS_DEFAULT : antialiasDraw);
        g.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION,
                antialiasAlpha == null ? RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT : antialiasAlpha);
    }
}