Package sino.controller.image

Examples of sino.controller.image.ImageConverterException


    private static BufferedImage readImage(InputStream is) throws ImageConverterException {
        BufferedImage image;
        try {
            image = ImageIO.read(is);
        } catch (IOException e) {
            throw new ImageConverterException("Cannot read the input image. IO error: " + e.getMessage(), e);
        }

        return image;
    }
View Full Code Here


        BufferedImage newImage = new BufferedImage(targetWidth, targetHeight, image.getType());
        newImage.createGraphics().drawImage(image, 0, 0, targetWidth, targetHeight, null);
        try {
            ImageIO.write(newImage, "JPG", os);
        } catch (IOException e) {
            throw new ImageConverterException("Cannot output the converted image. IO error: " + e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of sino.controller.image.ImageConverterException

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.