Package com.sun.image.codec.jpeg

Examples of com.sun.image.codec.jpeg.JPEGEncodeParam


      GifEncoder gifEncoder = new GifEncoder(img);
      gifEncoder.encode(stream);
    }
    else if (type.equalsIgnoreCase("jpg") || type.equalsIgnoreCase("jpeg")) {
      JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(stream);
      JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(img);
      param.setQuality(quality, false);
      encoder.setJPEGEncodeParam(param);
      encoder.encode(img);
    }
    else {
      throw new IOException("Unsupported image format: " + type);
View Full Code Here


        } catch (java.io.FileNotFoundException io) {
            System.out.println("File Not Found");
        }

        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
        JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(buffImg);
        param.setQuality(0.5f, false);
        encoder.setJPEGEncodeParam(param);

        try {
            encoder.encode(buffImg);
            out.close();
View Full Code Here

        } catch (java.io.FileNotFoundException io) {
            System.out.println("File Not Found");
        }

        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
        JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(buffImg);
        param.setQuality(0.5f, false);
        encoder.setJPEGEncodeParam(param);

        try {
            encoder.encode(buffImg);
            out.close();
View Full Code Here

        } catch (java.io.FileNotFoundException io) {
            System.out.println("File Not Found");
        }

        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
        JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(buffImg);
        param.setQuality(0.5f, false);
        encoder.setJPEGEncodeParam(param);

        try {
            encoder.encode(buffImg);
            out.close();
View Full Code Here

TOP

Related Classes of com.sun.image.codec.jpeg.JPEGEncodeParam

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.