Package java.awt

Examples of java.awt.GraphicsConfiguration.createCompatibleImage()


            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


    }

    frame.createBufferStrategy(2);
    frame.setBackground(Color.BLACK);
    buffer = frame.getBufferStrategy();
    bi = gc.createCompatibleImage(game.getWidth(), game.getHeight());

    //calculate the x and y for centering in fullscreen mode.
   
    if(!game.isDebug())
    {
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

    {
      GraphicsEnvironment ge = GraphicsEnvironment
          .getLocalGraphicsEnvironment();
      GraphicsDevice gd = ge.getDefaultScreenDevice();
      GraphicsConfiguration gc = gd.getDefaultConfiguration();
      return gc.createCompatibleImage(width, height,
          Transparency.TRANSLUCENT);
    }

    public BufferedImage getGrayscaleBufferedImage(int width, int height,
        boolean hasAlpha)
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

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

        BufferedImage outputImg = gc.createCompatibleImage(100, 70,
            Transparency.BITMASK);

        Graphics2D g = outputImg.createGraphics();
        // g.setClip(new Rectangle(new Dimension(40, 40)));
        g.drawImage(outputImg, null, 0, 0);
View Full Code Here

                    || (this.chartBufferWidth != available.getWidth())
                    || (this.chartBufferHeight != available.getHeight())) {
                this.chartBufferWidth = (int) available.getWidth();
                this.chartBufferHeight = (int) available.getHeight();
                GraphicsConfiguration gc = g2.getDeviceConfiguration();
                this.chartBuffer = gc.createCompatibleImage(
                        this.chartBufferWidth, this.chartBufferHeight,
                        Transparency.TRANSLUCENT);
                this.refreshBuffer = true;
            }
View Full Code Here

                    || (this.chartBufferWidth != available.getWidth())
                    || (this.chartBufferHeight != available.getHeight())) {
                this.chartBufferWidth = (int) available.getWidth();
                this.chartBufferHeight = (int) available.getHeight();
                GraphicsConfiguration gc = g2.getDeviceConfiguration();
                this.chartBuffer = gc.createCompatibleImage(
                        this.chartBufferWidth, this.chartBufferHeight,
                        Transparency.TRANSLUCENT);
                this.refreshBuffer = true;
            }
View Full Code Here

      int hCount = heigth/ySize;
      if (heigth%ySize>0){
        hCount++;
      }
   
    BufferedImage img = gconf.createCompatibleImage(vCount*xSize, hCount*ySize, Transparency.BITMASK);
   
    // fill in the image
    Graphics2D g = img.createGraphics();
    for (int xCount=0;xCount<=vCount;xCount++){
      for (int yCount=0;yCount<=hCount;yCount++){
View Full Code Here

      int hCount = heigth/ySize;
      if (heigth%ySize>0){
        hCount++;
      }
   
    BufferedImage img = gconf.createCompatibleImage(vCount*xSize, hCount*ySize, Transparency.BITMASK);
   
    // fill in the image
    Graphics2D g = img.createGraphics();
    for (int xCount=0;xCount<=vCount;xCount++){
      for (int yCount=0;yCount<=hCount;yCount++){
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.