Package com.alibaba.simpleimage.render

Examples of com.alibaba.simpleimage.render.FixDrawTextItem


    static final Color FONT_SHADOW_COLOR = new Color(170, 170, 170, 77);
    static final Font  FONT              = new Font("黑体", Font.PLAIN, 10);

    protected DrawTextParameter getParam() {
        DrawTextParameter param = new DrawTextParameter();
        param.addTextInfo(new FixDrawTextItem("这是测试中文好不好用"));

        return param;
    }
View Full Code Here


        doDrawImageText("snow.jpg", "corner-", item);
        doDrawImageText("st.jpg", "corner-", item);
    }

    public void testFixDrawTextItem() throws Exception {
        FixDrawTextItem item = new FixDrawTextItem("远华贸易实业有限公司", new Color(255, 255, 255, 115), new Color(170, 170, 170, 77),
                                                   FontManager.getFont("方正黑体"), 10, FixDrawTextItem.Position.BOTTOM_RIGHT, 0.5f);
        doDrawImageText("334.jpg", "fix-", item);
        doDrawImageText("yuan.jpg", "fix-", item);
        doDrawImageText("snow.jpg", "fix-", item);
        doDrawImageText("st.jpg", "fix-", item);
View Full Code Here

            File f = new File(dir, sourceName);
            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

    }

    public DrawTextParameter createDrawTextParameter(String mainTxt, boolean drawMainTxt, boolean drawFootTxt) {
        List<DrawTextItem> textItems = new ArrayList<DrawTextItem>(4);
        if (drawMainTxt) {
            DrawTextItem mainTextItem = new FixDrawTextItem(mainTxt);
            textItems.add(mainTextItem);
        }

        if (drawFootTxt) {
            DrawTextItem footTextItem = new FootnoteDrawTextItem(mainTxt, "www.alibaba.com.cn");
View Full Code Here

        assertNotNull(NodeUtils.getChild(newImg.getMetadata(0), "LocalColorTable"));
    }

    public void testCloneJPEGOutput() throws Exception {
        DrawTextParameter dparam = new DrawTextParameter();
        dparam.addTextInfo(new FixDrawTextItem("alibaba"));

        File[] files = jpgDir.listFiles();
 

        for (File file : files) {
View Full Code Here

        }
    }

    public void testCloneGIFOutput() throws Exception {
        DrawTextParameter dparam = new DrawTextParameter();
        dparam.addTextInfo(new FixDrawTextItem("alibaba"));
       
        File[] files2 = gifDir.listFiles();
        for (File file : files2) {
            String fileName = file.getName().toLowerCase();
            if (fileName.endsWith("gif")) {
View Full Code Here

        }

        public DrawTextParameter createDrawTextParameter(String mainTxt, boolean drawMainTxt, boolean drawFootTxt) {
            List<DrawTextItem> textItems = new ArrayList<DrawTextItem>(4);
            if (drawMainTxt) {
                DrawTextItem mainTextItem = new FixDrawTextItem(mainTxt);
                textItems.add(mainTextItem);
            }

            if (drawFootTxt) {
                DrawTextItem footTextItem = new FootnoteDrawTextItem(mainTxt, "www.alibaba.com.cn");
View Full Code Here

TOP

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

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.