Package com.kitfox.svg.app.beans

Examples of com.kitfox.svg.app.beans.SVGIcon


        if (matchName.matches()) {
            shortName = matchName.group(1);
        }
        shortName += "." + format;

        SVGIcon icon = new SVGIcon();
        icon.setSvgURI(source.toURI());
        icon.setAntiAlias(antiAlias);

        maybeResizeIcon(icon);

        int width = icon.getIconWidth();
        int height = icon.getIconHeight();
        icon.setClipToViewbox(clipToViewBox);
        BufferedImage image = new BufferedImage(width, height,
                BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = image.createGraphics();
        g = new ImageResizingGraphics(g);

        if (bgColor != null) {
            g.setColor(bgColor);
            g.fillRect(0, 0, width, height);
        }

        g.setClip(0, 0, width, height);
        icon.paintIcon(null, g, 0, 0);
        g.dispose();

        File outFile = destDir == null ? new File(baseDir, shortName)
                : new File(destDir, shortName);
        if (verbose)
View Full Code Here


        try
        {
            String fileName = imageURL.getFile();
            if (".svg".equals(fileName.substring(fileName.length() - 4).toLowerCase()))
            {
                SVGIcon icon = new SVGIcon();
                icon.setSvgURI(imageURL.toURI());
               
                BufferedImage img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
                Graphics2D g = img.createGraphics();
                icon.paintIcon(null, g, 0, 0);
                g.dispose();
                ref = new SoftReference(img);
            }
            else
            {
View Full Code Here

        try
        {
            String fileName = imageURL.getFile();
            if (".svg".equals(fileName.substring(fileName.length() - 4).toLowerCase()))
            {
                SVGIcon icon = new SVGIcon();
                icon.setSvgURI(imageURL.toURI());

                BufferedImage img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
                Graphics2D g = img.createGraphics();
                icon.paintIcon(null, g, 0, 0);
                g.dispose();
                ref = new SoftReference(img);
            } else
            {
                BufferedImage img = ImageIO.read(imageURL);
View Full Code Here

TOP

Related Classes of com.kitfox.svg.app.beans.SVGIcon

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.