Example usage for javax.imageio ImageWriteParam MODE_DEFAULT

List of usage examples for javax.imageio ImageWriteParam MODE_DEFAULT

Introduction

In this page you can find the example usage for javax.imageio ImageWriteParam MODE_DEFAULT.

Prototype

int MODE_DEFAULT

To view the source code for javax.imageio ImageWriteParam MODE_DEFAULT.

Click Source Link

Document

A constant value that may be passed into methods such as setTilingMode , setProgressiveMode , and setCompressionMode to enable that feature for future writes.

Usage

From source file:eu.delving.ChartEngine.java

private void writePNG(OutputStream outputStream, JFreeChart chart) throws IOException {
    ChartUtilities.writeChartAsPNG(outputStream, chart, width, height, true, ImageWriteParam.MODE_DEFAULT);
}

From source file:org.mycore.iview2.frontend.MCRTileCombineServlet.java

/**
 * Initializes this instance.//from   w  w  w.ja  va2s  .c o m
 * 
 * Use parameter <code>org.mycore.iview2.frontend.MCRFooterInterface</code> to specify implementation of {@link MCRFooterInterface} (can be omitted).
 */
@Override
public void init() throws ServletException {
    super.init();
    imageWriteParam = new JPEGImageWriteParam(Locale.getDefault());
    try {
        imageWriteParam.setProgressiveMode(ImageWriteParam.MODE_DEFAULT);
    } catch (UnsupportedOperationException e) {
        LOGGER.warn("Your JPEG encoder does not support progressive JPEGs.");
    }
    imageWriteParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
    imageWriteParam.setCompressionQuality(QUALITY);
    String footerClassName = getInitParameter(MCRFooterInterface.class.getName());
    if (footerClassName != null) {
        try {
            footerImpl = (MCRFooterInterface) Class.forName(footerClassName).newInstance();
        } catch (Exception e) {
            throw new ServletException("Could not initialize MCRFooterInterface", e);
        }
    }
}