Package java.awt

Examples of java.awt.GraphicsConfiguration.createCompatibleImage()


    // code from
    // http://weblogs.java.net/blog/campbell/archive/2006/07/java_2d_tricker.html
    int width = logo.getWidth();
    int height = logo.getHeight();
    GraphicsConfiguration gc = g2d.getDeviceConfiguration();
    BufferedImage img = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
    Graphics2D g2 = img.createGraphics();

    g2.setComposite(AlphaComposite.Clear);
    g2.fillRect(0, 0, width, height);
View Full Code Here


        //GENERATE MERGED TILE IMAGE
        //FIXME: although faster, the following doesn't seem to handle alpha on some platforms...
        GraphicsConfiguration config =
            GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        Image tileImg = config.createCompatibleImage(c.getWidth(), c.getHeight());
        c.render(tileImg.getGraphics());
        tile.setImage(tileImg);

        myTs.addTile(tile);
View Full Code Here

            }
   
            // Create the buffered image
            GraphicsDevice gs = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gs.getDefaultConfiguration();
            bimage = gc.createCompatibleImage(
                image.getWidth(null), image.getHeight(null), transparency);
        } catch (HeadlessException e) {
            // The system does not have a screen
        }
   
View Full Code Here

            // Paint the display into an offscreen buffer
            GraphicsConfiguration gc = graphics.getDeviceConfiguration();
            java.awt.Rectangle clipBounds = graphics.getClipBounds();
            java.awt.image.BufferedImage bufferedImage =
                gc.createCompatibleImage(clipBounds.width, clipBounds.height,
                    Transparency.OPAQUE);

            if (bufferedImage != null) {
                Graphics2D bufferedImageGraphics = (Graphics2D)bufferedImage.getGraphics();
                bufferedImageGraphics.setClip(0, 0, clipBounds.width, clipBounds.height);
View Full Code Here

        BufferedImage argbImage = new BufferedImage(width, height, imageType);

        // from there, create an image with Transparency.BITMASK
        Graphics2D g = argbImage.createGraphics();
        GraphicsConfiguration gc = g.getDeviceConfiguration();
        argbImage = gc.createCompatibleImage(width, height, Transparency.BITMASK);
        g.dispose();
        // create a red rectangle
        g = argbImage.createGraphics();
        g.setColor(Color.red);
        g.fillRect(0, 0, width, height);
View Full Code Here

            // Paint the display into an offscreen buffer
            GraphicsConfiguration gc = graphics.getDeviceConfiguration();
            java.awt.Rectangle clipBounds = graphics.getClipBounds();
            java.awt.image.BufferedImage bufferedImage =
                gc.createCompatibleImage(clipBounds.width, clipBounds.height,
                    Transparency.OPAQUE);

            if (bufferedImage != null) {
                Graphics2D bufferedImageGraphics = (Graphics2D)bufferedImage.getGraphics();
                bufferedImageGraphics.setClip(0, 0, clipBounds.width, clipBounds.height);
View Full Code Here

            if (bufferedImage == null
                || bufferedImageGC != gc
                || bufferedImage.getWidth() < clipBounds.width
                || bufferedImage.getHeight() < clipBounds.height) {

                bufferedImage = gc.createCompatibleImage(clipBounds.width,
                    clipBounds.height, Transparency.OPAQUE);
                bufferedImageGC = gc;
            }

            if (bufferedImage != null) {
View Full Code Here

            paint0(graphics);
        } else {
            boolean freshImage = false;
            if (doubleBufferImage == null) {
                GraphicsConfiguration gc = graphics.getDeviceConfiguration();
                doubleBufferImage = gc.createCompatibleImage(getWidth(), getHeight(),
                        Transparency.OPAQUE);
                doubleBufferedRepaintRequired = true;
                freshImage = true;
            }
View Full Code Here

        this.height = height;

        GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
        GraphicsConfiguration gc = gd.getDefaultConfiguration();

        transitionImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
        templateImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
        alertImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
        backgroundImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);

        run = true;
View Full Code Here

        GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
        GraphicsConfiguration gc = gd.getDefaultConfiguration();

        transitionImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
        templateImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
        alertImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);
        backgroundImage = gc.createCompatibleImage(width, height, Transparency.TRANSLUCENT);

        run = true;
        updThread = new UpdateThread();
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.