Package java.awt

Examples of java.awt.Graphics.drawImage()


    if (myCurrentTile!=tileY) {
            int offsety = tileY*getTileHeight();
            BufferedImage tile = getChart(myTaskImage.getWidth(), offsety, getTileWidth(),getTileHeight(),  getWidth(), getHeight());
            Graphics g = tile.getGraphics();
            g.translate(0, -offsety);
            g.drawImage(myTaskImage,0,0,null);
            myCurrentRaster = tile.getRaster().createTranslatedChild(0, tileY*getTileHeight());
            myCurrentTile = tileY;
    }
    return myCurrentRaster;
    }
View Full Code Here


                              new GrayFilter()));
                              UIUtil.waitFor(img, this);
                          }
                         
                          if (img != null) {
                              g.drawImage(img, px, py + ((itemHeight - img.getHeight(this)) / 2), this);
                              toff = imageTextGap + img.getWidth(this);
                          }
                      }
                      g.drawString(n, px + toff, py + fm.getHeight() - fm.getDescent() + ((itemHeight - fm.getHeight()) / 2));
                      py += itemHeight;
View Full Code Here

        if (height != -1 && height != image.getHeight()) {
          int width = image.getWidth() * height / image.getHeight();
          // Create a scaled image not bound to original image to let the original image being garbage collected
          BufferedImage scaledImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
          Graphics g = scaledImage.getGraphics();
          g.drawImage(image.getScaledInstance(width, height, Image.SCALE_SMOOTH), 0, 0, null);
          g.dispose();
          return new ImageIcon(scaledImage);
        } else {
          return new ImageIcon(image);
        }
View Full Code Here

        BufferedImage offScreenImage = this.homeComponent3D.getOffScreenImage(
            2 * this.image.getWidth(), 2 * this.image.getHeight());

        checkLaunchingThreadIsntInterrupted();
        Graphics graphics = this.image.getGraphics();
        graphics.drawImage(offScreenImage.getScaledInstance(
            this.image.getWidth(), this.image.getHeight(), Image.SCALE_SMOOTH), 0, 0, null);
        graphics.dispose();
        checkLaunchingThreadIsntInterrupted();
        return this.image;
      } catch(InterruptedIOException ex) {
View Full Code Here

        ((Graphics2D)memG).
          setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                           RenderingHints.VALUE_ANTIALIAS_OFF);
      }

      g.drawImage(memImage, 0, 0, null);

    }
    isPainting = false;
  }
View Full Code Here

    g.setClip(p);
    g.clipRect(oldClip.x, oldClip.y, oldClip.width, oldClip.height);
   
    // top border
    for (int i = x; i < x + width; i += imageWidth) {
      g.drawImage(topLeftImage, i, y, null);
    }
    // left border
    for (int i = y; i < y + height; i += imageHeight) {
      g.drawImage(topLeftImage, x, i, null);
    }
View Full Code Here

    for (int i = x; i < x + width; i += imageWidth) {
      g.drawImage(topLeftImage, i, y, null);
    }
    // left border
    for (int i = y; i < y + height; i += imageHeight) {
      g.drawImage(topLeftImage, x, i, null);
    }
   
    // *** Clipping for bottom and right borders ***
    // We have the same number of vertices as before, so it's efficient to
    // reuse the polygon 
View Full Code Here

    // tile border coincides to be inside the bottom border.
    int startY = y + height - borderWidth - (height - borderWidth) % imageHeight;
    int endY = y + height - height % imageHeight;
    for (int borderY = startY; borderY <= endY; borderY += imageHeight) {
      for (int i = x; i < x + width; i += imageWidth) {
        g.drawImage(bottomRightImage, i, borderY, null);
      }
    }
    // Right border. More than one x coordinate may be needed in case the
    // tile border coincides to be inside the right border.
    int startX = x + width - borderWidth - (width - borderWidth) % imageWidth;
View Full Code Here

    // tile border coincides to be inside the right border.
    int startX = x + width - borderWidth - (width - borderWidth) % imageWidth;
    int endX = x + width - width % imageWidth;
    for (int borderX = startX; borderX <= endX; borderX += imageWidth) {
      for (int i = y; i < y + height; i += imageHeight) {
        g.drawImage(bottomRightImage, borderX, i, null);
      }
    }
   
    g.dispose();
  }
View Full Code Here

    Image bg = createIconBackground(gc);
   
    // copy bg for drawing
    Image image = gc.createCompatibleImage(TITLEBAR_HEIGHT, TITLEBAR_HEIGHT, Transparency.OPAQUE);
    Graphics g = image.getGraphics();
    g.drawImage(bg, 0, 0, null);
    closeIcon = createCloseIcon(image);
   
    // now we can draw over the background image
    minimizeIcon = createMinimizeIcon(bg);
  }
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.