Package com.alibaba.simpleimage.render

Examples of com.alibaba.simpleimage.render.DrawTextRender


            output = new ByteArrayOutputStream();
            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) {
View Full Code Here


     * {@link com.alibaba.simpleimage.render.DrawTextRender#DrawTextRender(java.io.InputStream, com.alibaba.simpleimage.render.DrawTextParameter)}
     * .
     */
    public void testDrawTextRenderInputStreamDrawTextParameter() throws Exception {
        InputStream file = new FileInputStream(getFileStr());
        ImageRender dr = new DrawTextRender(file, getParam());
        write(dr);
        file.close();
    }
View Full Code Here

     * {@link com.alibaba.simpleimage.render.DrawTextRender#DrawTextRender(java.io.InputStream, boolean, com.alibaba.simpleimage.render.DrawTextParameter)}
     * .
     */
    public void testDrawTextRenderInputStreamBooleanDrawTextParameter() throws Exception {
        InputStream file = new FileInputStream(getFileStr());
        ImageRender dr = new DrawTextRender(file, true, getParam());
        write(dr);
        file.close();
    }
View Full Code Here

            if (items != null) {
                for (DrawTextItem itm : items) {
                    dp.addTextInfo(itm);
                }
            }
            DrawTextRender dtr = new DrawTextRender(rr, dp);

            fr = new WriteRender(dtr, new File(rpath, "DRAWTEXT_" + desc + imageName.substring(0, imageName.lastIndexOf("."))
                                                      + ".jpg"));
            fr.render();
        } finally {
View Full Code Here

            in = new FileInputStream(f);
            ReadRender rr = new ReadRender(in);

            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);
View Full Code Here

    }

    void draw(ImageWrapper imgWrapper, DrawTextParameter param, File output, ImageFormat format) throws Exception {
        WriteRender wr = null;
        try {
            ImageRender sr = new DrawTextRender(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.DrawTextRender

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.