Package com.sixlegs.png

Examples of com.sixlegs.png.PngImage


        imagePanel = new ImagePanel();
        Dimension size = new Dimension(400, 300);
        File file = (args.length > 0) ? new File(args[0]) : null;
        if (file != null) {
            try {
                PngImage png = readHeader(file);       
                size.setSize(png.getWidth(), png.getHeight());
            } catch (IOException e) {
                // ignore here, open will re-throw
            }
        }
        imagePanel.setStretchMode(ImagePanel.STRETCH_PRESERVE);
View Full Code Here


    }

    private static PngImage readHeader(File file)
    throws IOException
    {
        PngImage png = new PngImage(new PngConfig.Builder().readLimit(PngConfig.READ_HEADER).build());
        png.read(file);
        return png;
    }
View Full Code Here

    }

    private BufferedImage readPngResource(String path)
    {
        try {
            return new PngImage().read(getClass().getResourceAsStream(path), true);
        } catch (IOException e) {
            throw new Error(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of com.sixlegs.png.PngImage

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.