Example usage for java.awt.image BufferedImageOp createCompatibleDestImage

List of usage examples for java.awt.image BufferedImageOp createCompatibleDestImage

Introduction

In this page you can find the example usage for java.awt.image BufferedImageOp createCompatibleDestImage.

Prototype

public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM);

Source Link

Document

Creates a zeroed destination image with the correct size and number of bands.

Usage

From source file:org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.internal.PdfGraphics2D.java

/**
 * @see Graphics2D#drawImage(BufferedImage, BufferedImageOp, int, int)
 *//*  w  ww.  j a  v  a2 s . co  m*/
@Override
public void drawImage(final BufferedImage img, final BufferedImageOp op, final int x, final int y) {
    BufferedImage result = img;
    if (op != null) {
        result = op.createCompatibleDestImage(img, img.getColorModel());
        result = op.filter(img, result);
    }
    drawImage(result, x, y, null);
}