Package java.awt.image

Examples of java.awt.image.VolatileImage


        return res;
    }

    public VolatileImage createCompatibleVolatileImage(int width, int height,
            ImageCapabilities caps, int transparency) throws AWTException {
        VolatileImage res = createCompatibleVolatileImage(width, height, transparency);
        if (!res.getCapabilities().equals(caps)) {
            // awt.14A=Can not create VolatileImage with specified capabilities
            throw new AWTException(Messages.getString("awt.14A")); //$NON-NLS-1$
        }
        return res;
    }
View Full Code Here


            }
            GraphicsConfiguration gc = getGraphicsConfiguration();
            if (gc == null) {
                return null;
            }
            VolatileImage image = gc.createCompatibleVolatileImage(width, height);
            fillImageBackground(image, width, height);
            return image;
        } finally {
            toolkit.unlockAWT();
        }
View Full Code Here

            }
            GraphicsConfiguration gc = getGraphicsConfiguration();
            if (gc == null) {
                return null;
            }
            VolatileImage image = gc.createCompatibleVolatileImage(width, height, caps);
            fillImageBackground(image, width, height);
            return image;
        } finally {
            toolkit.unlockAWT();
        }
View Full Code Here

            }
            GraphicsConfiguration gc = getGraphicsConfiguration();
            if (gc == null) {
                return null;
            }
            VolatileImage image = gc.createCompatibleVolatileImage(width, height);
            fillImageBackground(image, width, height);
            return image;
        } finally {
            toolkit.unlockAWT();
        }
View Full Code Here

    ***************************************************************************/


    public VolatileImage createCompatibleVolatileImage(int width, int height,
            ImageCapabilities caps) throws AWTException {
        VolatileImage res = createCompatibleVolatileImage(width, height);
        if (!res.getCapabilities().equals(caps)) {
            // awt.14A=Can not create VolatileImage with specified capabilities
            throw new AWTException(Messages.getString("awt.14A")); //$NON-NLS-1$
        }
        return res;
    }
View Full Code Here

        return res;
    }

    public VolatileImage createCompatibleVolatileImage(int width, int height,
            ImageCapabilities caps, int transparency) throws AWTException {
        VolatileImage res = createCompatibleVolatileImage(width, height, transparency);
        if (!res.getCapabilities().equals(caps)) {
            // awt.14A=Can not create VolatileImage with specified capabilities
            throw new AWTException(Messages.getString("awt.14A")); //$NON-NLS-1$
        }
        return res;
    }
View Full Code Here

        if (gc.getColorModel().getPixelSize() < 16) {
            System.out.println("8-bit desktop depth found, test passed");
            return;
        }

        VolatileImage vi = gc.createCompatibleVolatileImage(R_WIDTH, R_HEIGHT);
        BufferedImage bi = null;
        do {
            vi.validate(gc);
            Graphics2D g = vi.createGraphics();
            render(g, vi.getWidth(), vi.getHeight());
            bi = vi.getSnapshot();
        } while (vi.contentsLost());

        checkBI(bi);
        System.out.println("Test PASSED.");
    }
View Full Code Here

            }
        } else {
            System.err.println("No screen rendering checks.");
        }

        VolatileImage vi = gc.createCompatibleVolatileImage(512, 512);
        vi.validate(gc);

        long timeStarted = System.currentTimeMillis();
        while (!done && (System.currentTimeMillis() - timeStarted) < RUN_TIME) {

            if (++cnt > 100) {
                int w = frame.getWidth() + incW;
                int h = frame.getHeight() + incH;
                if (w < minW || w > maxW ) {
                    incW = -incW;
                }
                if (h < minH || h > maxH ) {
                    incH = -incH;
                }
                frame.setSize(w, h);
                cnt = 0;
            }

            // try to put the device into non-default state, for example,
            // this operation below will set the transform
            vi.validate(gc);
            Graphics2D vig = (Graphics2D)vi.getGraphics();
            vig.rotate(30.0f, vi.getWidth()/2, vi.getHeight()/2);
            vig.drawImage(output, 0, 0,
                          vi.getWidth(), vi.getHeight(), null);

            Insets in = frame.getInsets();
            frame.getGraphics().drawImage(output, in.left, in.top, null);
            if (cnt == 90 && robot != null) {
                // area where we blitted to should be either white or green
View Full Code Here

        g.setColor(Color.green);
        g.fillRect(0, 0, w, h);

        int bltWidth = srcRect.width;
        int bltHeight = srcRect.height;
        VolatileImage vi = null;
        if (image instanceof VolatileImage) {
            vi = (VolatileImage)image;
        }
        do {
            if (vi != null) {
                GraphicsConfiguration gc = getGraphicsConfiguration();
                if (vi.validate(gc) != VolatileImage.IMAGE_OK) {
                    initImage(gc, vi);
                }
            }
            g.drawImage(image,
                    dstRect.x, dstRect.y,
                    dstRect.x + bltWidth, dstRect.y + bltHeight,
                    srcRect.x, srcRect.y,
                    srcRect.x + bltWidth, srcRect.y + bltHeight,
                    Color.red,
                    null);
        } while (vi != null && vi.contentsLost());
    }
View Full Code Here

    }

    static VolatileImage getVImage(GraphicsConfiguration gc,
                                   int w, int h)
    {
        VolatileImage image =
            gc.createCompatibleVolatileImage(w, h, Transparency.OPAQUE);
        image.validate(gc);
        initImage(gc, image);
        return image;
    }
View Full Code Here

TOP

Related Classes of java.awt.image.VolatileImage

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.