Package java.awt

Examples of java.awt.GraphicsConfiguration.createCompatibleImage()


        {
            GraphicsEnvironment env = GraphicsEnvironment.
                    getLocalGraphicsEnvironment();
            GraphicsDevice gd = env.getDefaultScreenDevice();
            GraphicsConfiguration gc = gd.getDefaultConfiguration();
            bi = gc.createCompatibleImage(getWidth(), getHeight(), TRANSPARENCY);
            drawOnImage((Graphics2D) bi.getGraphics());
        }
        g2d.setRenderingHint(AA_KEY, AA_VALUE);
        g2d.drawImage(bi, 0, 0, null);
        super.paintComponent(g2d);
View Full Code Here


    {
        GraphicsEnvironment env = GraphicsEnvironment.
                getLocalGraphicsEnvironment();
        GraphicsDevice gd = env.getDefaultScreenDevice();
        GraphicsConfiguration gc = gd.getDefaultConfiguration();
        bi = gc.createCompatibleImage(getWidth(), H, TYPE);
        rect = new Rectangle(0, 0, getWidth(), H);
    }

    /** Performs the actual paint onto the buffered graphics object.
     * @param g2d The buffered graphics object. */
 
View Full Code Here

        if (defaultContrast == null) {
            GraphicsConfiguration gc =
            GraphicsEnvironment.getLocalGraphicsEnvironment().
                getDefaultScreenDevice().getDefaultConfiguration();
        Graphics2D g2d =
            (Graphics2D)(gc.createCompatibleImage(1,1).getGraphics());
        defaultContrast = (Integer)
            g2d.getRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST);
        }
        return defaultContrast;
    }
View Full Code Here

        }

        public Image makeImage(TestEnvironment env, int w, int h) {
            Canvas c = env.getCanvas();
            GraphicsConfiguration gc = c.getGraphicsConfiguration();
            return gc.createCompatibleImage(w, h, transparency);
        }
    }

    public static class BufImg extends TriStateImageType {
        int type;
View Full Code Here

    GraphicsConfiguration graphicsConfiguration = GraphicsEnvironment.
        getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
   
    // Attempt to use an optimized buffered image to avoid an additional
    // color space conversion on each redraw.
    BufferedImage optimalImage = graphicsConfiguration.createCompatibleImage(width, height, Transparency.OPAQUE);
    ColorModel optimalCm = optimalImage.getColorModel();
    int redIndex = optimalCm.getRed(REFERENCE_PIXEL);
    int greenIndex = optimalCm.getGreen(REFERENCE_PIXEL);
    int blueIndex = optimalCm.getBlue(REFERENCE_PIXEL);
    if (optimalCm.hasAlpha()) {
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

        }
        BufferedImage sourceImage = getImageFromUrl(imageUrl);

        // crea una imagen acelerada para almacenar es sprite dentro
        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        Image image = gc.createCompatibleImage(sourceImage.getWidth(), sourceImage.getHeight(), Transparency.BITMASK);
        //todo esto se hace para que no trabaje la CPU, la placa de video debe hacer el trabajo

        // dibuja nuestra imagen fuente dentro de una imagen acelerada
        image.getGraphics().drawImage(sourceImage, 0, 0, null);
   
View Full Code Here

    public static void main(String[] args) {
        GraphicsConfiguration gc =
            GraphicsEnvironment.getLocalGraphicsEnvironment().
                getDefaultScreenDevice().getDefaultConfiguration();

        bmImage = gc.createCompatibleImage(64, 64, Transparency.BITMASK);
        argbImage = gc.createCompatibleImage(64, 64, Transparency.TRANSLUCENT);

        if (gc.getColorModel().getPixelSize() > 8) {
            VolatileImage vi =
                gc.createCompatibleVolatileImage(64, 64, Transparency.OPAQUE);
View Full Code Here

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

        bmImage = gc.createCompatibleImage(64, 64, Transparency.BITMASK);
        argbImage = gc.createCompatibleImage(64, 64, Transparency.TRANSLUCENT);

        if (gc.getColorModel().getPixelSize() > 8) {
            VolatileImage vi =
                gc.createCompatibleVolatileImage(64, 64, Transparency.OPAQUE);
            do {
View Full Code Here

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

        BufferedImage result = gc.createCompatibleImage(neww, newh, Transparency.TRANSLUCENT);
        Graphics2D g = result.createGraphics();
        g.translate((neww-w)/2, (newh-h)/2);
        g.rotate(angle, w/2, h/2);
        g.drawRenderedImage(image, null);
        g.dispose();
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.