Package java.awt

Examples of java.awt.GraphicsConfiguration.createCompatibleImage()


  // for my Player
  this.sprite_mplayer = new Vector<Sprite>();
  tempSprite = new Sprite(ImageList.getImage("mplayer"));
  for (int i=0;i<=13;i++)
    {
        Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
        tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
        sprite_mplayer.add(new Sprite(image));
    }
  // and other Players
  this.sprite_oplayer = new Vector<Sprite>();
View Full Code Here


  // and other Players
  this.sprite_oplayer = new Vector<Sprite>();
  tempSprite = new Sprite(ImageList.getImage("oplayer"));
  for (int i=0;i<=13;i++)
    {
        Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
        tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
        sprite_oplayer.add(new Sprite(image));
   
  // and other Players
  this.sprite_pplayer = new Vector<Sprite>();
View Full Code Here

  // and other Players
  this.sprite_pplayer = new Vector<Sprite>();
  tempSprite = new Sprite(ImageList.getImage("pplayer"));
  for (int i=0;i<=13;i++)
    {
        Image image = gc.createCompatibleImage(PIXEL_SCALE,PIXEL_SCALE,Transparency.BITMASK);
        tempSprite.draw(image.getGraphics(),0,0,i*PIXEL_SCALE,0);
        sprite_pplayer.add(new Sprite(image));
   
  // ALL IMAGES ADDED
 
View Full Code Here

            // Create the buffered image
            GraphicsDevice        gs = ge.getDefaultScreenDevice();
            GraphicsConfiguration gc = gs.getDefaultConfiguration();

            bimage = gc.createCompatibleImage(width, height, transparency);
        } catch (HeadlessException e) {
            // The system does not have a screen
        }

        if (bimage == null) {
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
        }

        if (bimage == null) {
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

        if ( im.getColorModel().equals( gfx_config.getColorModel() ) ) {
            return im;
        }

        // image is not optimized, so create a new image that is
        BufferedImage new_image = gfx_config.createCompatibleImage(
                im.getWidth(), im.getHeight(), im.getTransparency() );

        // get the graphics context of the new image to draw the old image on
        Graphics2D g2d = (Graphics2D) new_image.getGraphics();
View Full Code Here

        this.setOpaque(false);
    }

    public void setBuffer() {
        GraphicsConfiguration configuration = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        vgBuffer = configuration.createCompatibleImage(bw, bh, Transparency.TRANSLUCENT);
    }

    public void paintComponent(Graphics g) {
        Graphics2D g2x = (Graphics2D) g;
        g2x.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
View Full Code Here

        if (image instanceof BufferedImage)
        return (BufferedImage) image;

        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        // BufferedImage bufferedImage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
        BufferedImage bufferedImage = gc.createCompatibleImage(100, 80, transparency);


        Graphics g = bufferedImage.createGraphics();
        g.drawImage(image, 0, 0, null);
        g.dispose();
View Full Code Here

        if (image instanceof BufferedImage)
        return (BufferedImage) image;

        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
        // BufferedImage bufferedImage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
        BufferedImage bufferedImage = gc.createCompatibleImage(100, 80, transparency);


        Graphics g = bufferedImage.createGraphics();
        g.drawImage(image, 0, 0, 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.