Package javax.swing

Examples of javax.swing.JComponent.createImage()


            //get image information
            if (imageType.equalsIgnoreCase("gif")) {
                Rectangle rect = GlobalFunction.checkMinimumViewport(view);
                Dimension size = new Dimension(rect.width + 10, rect.height + 10);

                image = comp.createImage(size.width, size.height);

                g2d = (Graphics2D) image.getGraphics();
                g2d.setColor(new Color(TRANSPARENT_BG_COLOR));
                g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight());
View Full Code Here


            //get image information
            if (imageType.equalsIgnoreCase("gif")) {
                Rectangle rect = GlobalFunction.checkMinimumViewport(view);
                Dimension size = new Dimension(rect.width + 10, rect.height + 10);

                image = comp.createImage(size.width, size.height);

                g2d = (Graphics2D) image.getGraphics();
                g2d.setColor(new Color(TRANSPARENT_BG_COLOR));
                g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight());
View Full Code Here

        // Get the size of the viewport
        JComponent canvas = imageDisplay.getCanvas();
        Dimension size = canvas.getSize();

        // Create a blank image the size of the original image
        paintedImage = canvas.createImage((int) size.getWidth(), (int) size.getHeight());

        // Get a Graphics object for the blank image
        Graphics2D g = (Graphics2D) paintedImage.getGraphics();
        g.setClip(0, 0, (int) size.getWidth(), (int) size.getHeight());
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.