Package net.datacrow.util.svg

Examples of net.datacrow.util.svg.SVGtoBufferedImageConverter


            image.setValue(Image._SYS_FILENAME, filename);
           
            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


            BrowserDialog dialog = new BrowserDialog("Select a new Image", new PictureFileFilter());
            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

Related Classes of net.datacrow.util.svg.SVGtoBufferedImageConverter

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.