Java 类org.jfree.chart.encoders.ImageFormat 实例源码

项目:astor    文件:SerialUtilities.java   
/**
 * Writes an image to the stream in PNG format.
 *
 * @param image  the image.
 * @param stream  the output stream.
 *
 * @throws IOException if there is an input/output error.
 *
 * @since 1.2.0
 */
public static void writeImage(Image image, ObjectOutputStream stream)
        throws IOException {
    BufferedImage bi = null;
    if (image instanceof BufferedImage) {
        bi = (BufferedImage) image;
    }
    else {
        bi = new BufferedImage(image.getWidth(null), image.getHeight(null),
                BufferedImage.TYPE_INT_ARGB);
        Graphics2D g2 = bi.createGraphics();
        g2.drawImage(image, 0, 0, null);
        g2.dispose();
    }
    EncoderUtil.writeBufferedImage(bi, ImageFormat.PNG, stream);
}
项目:c2mon-web-ui    文件:JFreeWebChart.java   
/**
 * Returns an image of the chart.
 *
 * @return the image
 * @throws
 */
@Override
public byte[] returnImage() {
    BufferedImage bufferedImage = jFreeChart.createBufferedImage(imageXPixels, imageYPixels);
    byte[] image = null;
    try {
        image = EncoderUtil.encode(bufferedImage, ImageFormat.PNG);

    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return image;
}
项目:mzmine2    文件:ChartExportUtil.java   
public static void writeChartToJPEG(JFreeChart chart, int width, int height, File fileName,
    int resolution) throws IOException {
  // Background color
  Paint saved = chart.getBackgroundPaint();
  if (((Color) saved).getAlpha() == 0) {
    chart.setBackgroundPaint(Color.WHITE);
    chart.setBackgroundImageAlpha(255);
    if (chart.getLegend() != null)
      chart.getLegend().setBackgroundPaint(Color.WHITE);
    // legends and stuff
    for (int i = 0; i < chart.getSubtitleCount(); i++)
      if (PaintScaleLegend.class.isAssignableFrom(chart.getSubtitle(i).getClass()))
        ((PaintScaleLegend) chart.getSubtitle(i)).setBackgroundPaint(Color.WHITE);

    // apply bg
    chart.getPlot().setBackgroundPaint(Color.WHITE);
  }
  //
  if (resolution == 72)
    writeChartToJPEG(chart, width, height, fileName);
  else {
    OutputStream out = new BufferedOutputStream(new FileOutputStream(fileName));
    try {
      BufferedImage image = paintScaledChartToBufferedImage(chart, out, width, height, resolution,
          BufferedImage.TYPE_INT_RGB);
      EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, 1.f);
    } finally {
      out.close();
    }
  }
}
项目:openreports    文件:ChartReportEngine.java   
private ChartEngineOutput createChartOutput(ReportChart reportChart, ChartValue[] values, boolean displayInline, Map parameters)
{
    JFreeChart chart = null;

    if (reportChart.getOverlayChart() != null)
    {
        chart = createOverlayChart(reportChart, values, displayInline, parameters);
    }
    else
    {
        chart = createChart(reportChart, values, displayInline);
    }

    if (chart == null) return null;

    chart.setBackgroundPaint(Color.WHITE);

    ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());

    BufferedImage bufferedImage =  chart.createBufferedImage(reportChart.getWidth(), reportChart.getHeight(),info);
    byte[] image = null;

    try
    {
        image = EncoderUtil.encode(bufferedImage, ImageFormat.PNG);
    }
    catch(IOException ioe)
    {
        log.warn(ioe);
    }

    ChartEngineOutput chartOutput = new ChartEngineOutput();
    chartOutput.setContent(image);
    chartOutput.setContentType(ReportEngineOutput.CONTENT_TYPE_JPEG);
    chartOutput.setChartRenderingInfo(info);
    chartOutput.setChartValues(values);

    return chartOutput;
}
项目:openreportsv2    文件:ChartReportEngine.java   
private ChartEngineOutput createChartOutput(ReportChart reportChart, ChartValue[] values, boolean displayInline, Map parameters)
{
    JFreeChart chart = null;

    if (reportChart.getOverlayChart() != null)
    {       
        chart = createOverlayChart(reportChart, values, displayInline, parameters);         
    }
    else
    {
        chart = createChart(reportChart, values, displayInline);
    }

    if (chart == null) return null;     

    chart.setBackgroundPaint(Color.WHITE);

    ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());

    BufferedImage bufferedImage =  chart.createBufferedImage(reportChart.getWidth(), reportChart.getHeight(),info);
    byte[] image = null;

    try
    {
        image = EncoderUtil.encode(bufferedImage, ImageFormat.PNG);
    }
    catch(IOException ioe)
    {
        log.warn(ioe);
    }

    ChartEngineOutput chartOutput = new ChartEngineOutput();
    chartOutput.setContent(image);  
    chartOutput.setContentType(ReportEngineOutput.CONTENT_TYPE_JPEG);
    chartOutput.setChartRenderingInfo(info);        
    chartOutput.setChartValues(values);

    return chartOutput;
}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows you to pass in a
 * {@link ChartRenderingInfo} object, to collect information about the chart
 * dimensions/entities.  You will need this info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out,
                                   JFreeChart chart,
                                   int width,
                                   int height,
                                   ChartRenderingInfo info) throws IOException {

    if (chart == null) throw new IllegalArgumentException("Null 'chart' argument.");
    BufferedImage bufferedImage = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows you to pass in a
 * {@link ChartRenderingInfo} object, to collect information about the chart
 * dimensions/entities.  You will need this info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out,
                                    JFreeChart chart,
                                    int width,
                                    int height,
                                    ChartRenderingInfo info) throws IOException {

    if (chart == null) throw new IllegalArgumentException("Null 'chart' argument.");
    BufferedImage image = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows you to pass in a
 * {@link ChartRenderingInfo} object, to collect information about the chart
 * dimensions/entities.  You will need this info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out,
                                    float quality,
                                    JFreeChart chart,
                                    int width,
                                    int height,
                                    ChartRenderingInfo info) throws IOException {

    if (chart == null) throw new IllegalArgumentException("Null 'chart' argument.");
    BufferedImage image = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
                                           BufferedImage image,
                                           boolean encodeAlpha,
                                           int compression) throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out, compression, encodeAlpha);
}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows 
 * you to pass in a {@link ChartRenderingInfo} object, to collect 
 * information about the chart dimensions/entities.  You will need this 
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
        int width, int height,  ChartRenderingInfo info) 
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage bufferedImage 
            = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows 
 * you to pass in a {@link ChartRenderingInfo} object, to collect 
 * information about the chart dimensions/entities.  You will need this 
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
        int width, int height, ChartRenderingInfo info) 
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage image = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows 
 * you to pass in a {@link ChartRenderingInfo} object, to collect 
 * information about the chart dimensions/entities.  You will need this 
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, float quality,
        JFreeChart chart, int width, int height, ChartRenderingInfo info) 
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage image = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
        BufferedImage image, boolean encodeAlpha, int compression) 
        throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out, 
            compression, encodeAlpha);
}
项目:parabuild-ci    文件:ChartUtilities.java   
/**
 * Encodes a {@link BufferedImage} to PNG format.
 *
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the PNG compression level (0-9).
 *
 * @return The byte array in PNG format.
 * 
 * @throws IOException if there is an I/O problem.
 */
public static byte[] encodeAsPNG(BufferedImage image, boolean encodeAlpha, 
                                 int compression) 
        throws IOException {
    return EncoderUtil.encode(image, ImageFormat.PNG, compression, 
            encodeAlpha);
}
项目:ccu-historian    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
        int width, int height,  ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage bufferedImage
            = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:ccu-historian    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
        int width, int height, ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(out, "out");
    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:ccu-historian    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, float quality,
        JFreeChart chart, int width, int height, ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(out, "out");
    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:ccu-historian    文件:ChartUtilities.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
        BufferedImage image, boolean encodeAlpha, int compression)
        throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out,
            compression, encodeAlpha);
}
项目:jfreechart    文件:ChartUtils.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream ({@code null} not permitted).
 * @param chart  the chart ({@code null} not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info ({@code null} permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
        int width, int height,  ChartRenderingInfo info)
        throws IOException {

    Args.nullNotPermitted(chart, "chart");
    BufferedImage bufferedImage
            = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:jfreechart    文件:ChartUtils.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream ({@code null} not permitted).
 * @param chart  the chart ({@code null} not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info ({@code null} permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
        int width, int height, ChartRenderingInfo info)
        throws IOException {

    Args.nullNotPermitted(out, "out");
    Args.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:jfreechart    文件:ChartUtils.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream ({@code null} not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart ({@code null} not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info ({@code null} permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, float quality,
        JFreeChart chart, int width, int height, ChartRenderingInfo info)
        throws IOException {

    Args.nullNotPermitted(out, "out");
    Args.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:jfreechart    文件:ChartUtils.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream ({@code null} not permitted).
 * @param image  the image ({@code null} not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
        BufferedImage image, boolean encodeAlpha, int compression)
        throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out,
            compression, encodeAlpha);
}
项目:aya-lang    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
        int width, int height,  ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage bufferedImage
            = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:aya-lang    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
        int width, int height, ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(out, "out");
    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:aya-lang    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, float quality,
        JFreeChart chart, int width, int height, ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(out, "out");
    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:aya-lang    文件:ChartUtilities.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
        BufferedImage image, boolean encodeAlpha, int compression)
        throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out,
            compression, encodeAlpha);
}
项目:HTML5_WebSite    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
        int width, int height,  ChartRenderingInfo info)
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage bufferedImage
            = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:HTML5_WebSite    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
        int width, int height, ChartRenderingInfo info)
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:HTML5_WebSite    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, float quality,
        JFreeChart chart, int width, int height, ChartRenderingInfo info)
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:HTML5_WebSite    文件:ChartUtilities.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
        BufferedImage image, boolean encodeAlpha, int compression)
        throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out,
            compression, encodeAlpha);
}
项目:HTML5_WebSite    文件:ChartUtilities.java   
/**
 * Encodes a {@link BufferedImage} to PNG format.
 *
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the PNG compression level (0-9).
 *
 * @return The byte array in PNG format.
 *
 * @throws IOException if there is an I/O problem.
 */
public static byte[] encodeAsPNG(BufferedImage image, boolean encodeAlpha,
                                 int compression)
        throws IOException {
    return EncoderUtil.encode(image, ImageFormat.PNG, compression,
            encodeAlpha);
}
项目:populus    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
        int width, int height,  ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage bufferedImage
            = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:populus    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
        int width, int height, ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(out, "out");
    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:populus    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, float quality,
        JFreeChart chart, int width, int height, ChartRenderingInfo info)
        throws IOException {

    ParamChecks.nullNotPermitted(out, "out");
    ParamChecks.nullNotPermitted(chart, "chart");
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:populus    文件:ChartUtilities.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
        BufferedImage image, boolean encodeAlpha, int compression)
        throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out,
            compression, encodeAlpha);
}
项目:PI    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in PNG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsPNG(OutputStream out, JFreeChart chart,
        int width, int height,  ChartRenderingInfo info)
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage bufferedImage
            = chart.createBufferedImage(width, height, info);
    EncoderUtil.writeBufferedImage(bufferedImage, ImageFormat.PNG, out);
}
项目:PI    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format. This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, JFreeChart chart,
        int width, int height, ChartRenderingInfo info)
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out);

}
项目:PI    文件:ChartUtilities.java   
/**
 * Writes a chart to an output stream in JPEG format.  This method allows
 * you to pass in a {@link ChartRenderingInfo} object, to collect
 * information about the chart dimensions/entities.  You will need this
 * info if you want to create an HTML image map.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param quality  the output quality (0.0f to 1.0f).
 * @param chart  the chart (<code>null</code> not permitted).
 * @param width  the image width.
 * @param height  the image height.
 * @param info  the chart rendering info (<code>null</code> permitted).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeChartAsJPEG(OutputStream out, float quality,
        JFreeChart chart, int width, int height, ChartRenderingInfo info)
        throws IOException {

    if (chart == null) {
        throw new IllegalArgumentException("Null 'chart' argument.");
    }
    BufferedImage image = chart.createBufferedImage(width, height,
            BufferedImage.TYPE_INT_RGB, info);
    EncoderUtil.writeBufferedImage(image, ImageFormat.JPEG, out, quality);

}
项目:PI    文件:ChartUtilities.java   
/**
 * Writes a {@link BufferedImage} to an output stream in PNG format.
 *
 * @param out  the output stream (<code>null</code> not permitted).
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the compression level (0-9).
 *
 * @throws IOException if there are any I/O errors.
 */
public static void writeBufferedImageAsPNG(OutputStream out,
        BufferedImage image, boolean encodeAlpha, int compression)
        throws IOException {

    EncoderUtil.writeBufferedImage(image, ImageFormat.PNG, out,
            compression, encodeAlpha);
}
项目:PI    文件:ChartUtilities.java   
/**
 * Encodes a {@link BufferedImage} to PNG format.
 *
 * @param image  the image (<code>null</code> not permitted).
 * @param encodeAlpha  encode alpha?
 * @param compression  the PNG compression level (0-9).
 *
 * @return The byte array in PNG format.
 *
 * @throws IOException if there is an I/O problem.
 */
public static byte[] encodeAsPNG(BufferedImage image, boolean encodeAlpha,
                                 int compression)
        throws IOException {
    return EncoderUtil.encode(image, ImageFormat.PNG, compression,
            encodeAlpha);
}