Package com.alibaba.simpleimage.render

Examples of com.alibaba.simpleimage.render.ScaleParameter


    }
   
    public void testSuperLargeImg() throws Exception {
        File img = new File(dir, "flower.jpg");
        File dest = new File(resultDir, "LANCZOS_flower_java_lanczos_result.jpg");
        ScaleParameter scaleParam = new ScaleParameter(1024, 1024, ScaleParameter.Algorithm.LANCZOS);
        doScale(img, dest, scaleParam);
    }
View Full Code Here


            DrawTextParameter dp = new DrawTextParameter();
            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;
View Full Code Here

                File outFile1 = new File(resultDir, "CLONEJPEG_" + fileName + "_1.jpg");
                File outFile2 = new File(resultDir, "CLONEJPEG_" + fileName + "_2.jpg");
                ImageWrapper imgWrapper = read(file);
                ImageWrapper cloneWrapper = (ImageWrapper) imgWrapper.clone();

                scale(imgWrapper, new ScaleParameter(100, 100), outFile1, ImageFormat.JPEG);
                draw(cloneWrapper, dparam, outFile2, ImageFormat.JPEG);
            }
        }
    }
View Full Code Here

                File outFile2 = new File(resultDir, "CLONEGIF_" + fileName + "_2.gif");
                ImageWrapper imgWrapper = read(file);
                ImageWrapper cloneWrapper = (ImageWrapper) imgWrapper.clone();

                draw(imgWrapper, dparam, outFile2, ImageFormat.GIF);
                scale(cloneWrapper, new ScaleParameter(100, 100), outFile1, ImageFormat.GIF);
            }
        }
    }
View Full Code Here

TOP

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

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.