Package com.day.image

Examples of com.day.image.Layer.drawText()


        }
        int width = Math.max((int) titleExtent.getWidth(), (int) subtitleExtent.getWidth());

        Layer text = new Layer(width, (int) titleExtent.getHeight() + 40, new Color(0x01ffffff, true));
        text.setPaint(titleColor);
        text.drawText(0, titleBase, 0, 0, title, titleFont, Font.ALIGN_LEFT | Font.ALIGN_BASE, 0, 0);
        text.resize(text.getWidth() / scale, text.getHeight() / scale);
        text.setX(0);
        text.setY(0);

        if (subtitle.length() > 0) {
View Full Code Here


            }
            String txt = titles[i].toUpperCase();
            if (txt.length() > 0) {
                Rectangle2D extent = fonts[i].getTextExtent(0, 0, 0, 0, txt, Font.ALIGN_LEFT, 0, 0);
                text.setPaint(colors[i]);
                text.drawText(0, y, 0, 0, txt, fonts[i], Font.ALIGN_LEFT, 0, 0);
                y += extent.getHeight() + 4 * scale;
            }
        }
        text.resize(text.getWidth() / scale, text.getHeight() / scale);
        text.setY(paddingY);
View Full Code Here

        text.setY(0);

        if (subtitle.length() > 0) {
            // draw the subtitle normal sized
            text.setPaint(subtitleColor);
            text.drawText(0, subTitleBase, 0, 0, subtitle, subTitleFont, Font.ALIGN_LEFT | Font.ALIGN_BASE, 0, 0);
        }

        // and merge the layers
        text.setY(paddingY);
        text.setX(paddingX);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.