Package net.datacrow.util.svg

Examples of net.datacrow.util.svg.SVGtoBufferedImageConverter.renderSVG()


           
            Picture pic = (Picture) DcModules.get(DcModules._PICTURE).getItem();
            DcImageIcon icon;
            if (filename.toLowerCase().endsWith(".svg")) {
                SVGtoBufferedImageConverter converter = new SVGtoBufferedImageConverter();
                BufferedImage bi = converter.renderSVG(filename);
                icon = new DcImageIcon(Utilities.getScaledImage(new DcImageIcon(bi), 400, 400));
                filename = File.createTempFile(String.valueOf(Utilities.getUniqueID()), ".png").toString();
                icon.setFilename(filename);
                icon.save();
                bi.flush();
View Full Code Here


            File file = dialog.showOpenFileDialog(this, null);
            if (file != null) {
               
                if (file.toString().toLowerCase().endsWith(".svg")) {
                    SVGtoBufferedImageConverter converter = new SVGtoBufferedImageConverter();
                    BufferedImage bi = converter.renderSVG(file.toString());
                    picture = new DcImageIcon(Utilities.getBytes(new DcImageIcon(bi)));
                } else {
                    String filename = file.toString().toLowerCase();
                    picture = new DcImageIcon(Utilities.getBytes(
                            Toolkit.getDefaultToolkit().createImage(Utilities.readFile(file)),
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.