Package com.alibaba.simpleimage.render

Examples of com.alibaba.simpleimage.render.ScaleRender


        ImageRender wr = null;
        try {
            inStream = new FileInputStream(in);
            outStream = new FileOutputStream(out);
            ImageRender rr = new ReadRender(inStream, toRGB);
            ImageRender sr = new ScaleRender(rr, scaleParam);
            wr = new WriteRender(sr, outStream, format);
            wr.render();
        } finally {
            IOUtils.closeQuietly(inStream);
            IOUtils.closeQuietly(outStream);
View Full Code Here


            ImageFormat outputFormat = ImageUtils.isGIF(inputStream) ? ImageFormat.GIF : ImageFormat.JPEG;
            ScaleParameter scaleParam = new ScaleParameter(maxWidth, maxHeight, Algorithm.AUTO);

            ImageRender rr = new ReadRender(inputStream, true);
            ImageRender dtr = new DrawTextRender(rr, drawParam);
            ImageRender sr = new ScaleRender(dtr, scaleParam);
            wr = new WriteRender(sr, output, outputFormat);

            wr.render();
        } catch (Exception e) {
            errorLog(inputStream);
View Full Code Here

    void doScaleWork(File in, boolean toRGB, File out, ImageFormat format) throws Exception {
        WriteRender wr = null;
        InputStream inStream = new FileInputStream(in);
        try {
            ReadRender rr = new ReadRender(inStream, toRGB);
            ScaleRender sr = new ScaleRender(rr, new ScaleParameter(100, 100));
            wr = new WriteRender(sr, out, format);
           
            wr.render();
        } finally {
            IOUtils.closeQuietly(inStream);
View Full Code Here

        ImageWrapper wmImage = null;
        ImageRender sr = null;
        try {
            in = new FileInputStream(new File(path, "alibaba1.gif"));
            rr = new ReadRender(in, false);
            sr = new ScaleRender(rr, new ScaleParameter(width, height, ScaleParameter.Algorithm.SUBSAMPLE_AVG));
            wmImage = sr.render();
        } finally {
            if (sr != null) {
                sr.dispose();
            }
View Full Code Here

            dp.addTextInfo(new FixDrawTextItem("1234554321"));
            DrawTextRender dtr = new DrawTextRender(rr, dp);
            // scale
            ScaleParameter param = new ScaleParameter(1024, 1024,
                    ScaleParameter.Algorithm.AUTO);
            ImageRender sr = new ScaleRender(dtr, param);

            output = new FileOutputStream(resultFile);
            ImageFormat outputFormat = sourceName.endsWith("gif") ? ImageFormat.GIF : ImageFormat.JPEG;
            wr = new WriteRender(sr, output, outputFormat);
View Full Code Here

    }

    void scale(ImageWrapper imgWrapper, ScaleParameter param, File output, ImageFormat format) throws Exception {
        WriteRender wr = null;
        try {
            ImageRender sr = new ScaleRender(imgWrapper, param);
            wr = new WriteRender(sr, output, format);

            wr.render();
        } finally {
            if (wr != null) {
View Full Code Here

TOP

Related Classes of com.alibaba.simpleimage.render.ScaleRender

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.