Example usage for java.awt RenderingHints VALUE_RENDER_SPEED

List of usage examples for java.awt RenderingHints VALUE_RENDER_SPEED

Introduction

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

Prototype

Object VALUE_RENDER_SPEED

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

Click Source Link

Document

Rendering hint value -- rendering algorithms are chosen with a preference for output speed.

Usage

From source file:sernet.verinice.service.commands.LoadAttachmentFile.java

private void drawThumbnail(BufferedImage image, BufferedImage resizedImage) {
    Graphics2D g = resizedImage.createGraphics();
    g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
    g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
    g.drawImage(image, 0, 0, resizedImage.getWidth(), resizedImage.getHeight(), null);
    g.dispose();/*w w w  . j  a  va 2s .c  o  m*/
}