Example usage for org.jfree.chart ChartUtilities encodeAsPNG

List of usage examples for org.jfree.chart ChartUtilities encodeAsPNG

Introduction

In this page you can find the example usage for org.jfree.chart ChartUtilities encodeAsPNG.

Prototype

public static byte[] encodeAsPNG(BufferedImage image, boolean encodeAlpha, int compression) throws IOException 

Source Link

Document

Encodes a BufferedImage to PNG format.

Usage

From source file:tdunnick.jphineas.console.queue.Charts.java

private byte[] getPNG(BufferedImage img) {
    try {// w  w  w .j  a  v a  2  s .  com
        return ChartUtilities.encodeAsPNG(img, true, 3);
    } catch (IOException e) {
        e.printStackTrace();
    }
    return null;
}