/** Make (scale down) the thumbnail */
  private Image getScaledImage(Image image, int breite, int hoehe) {

    Image scaledImage = image.getScaledInstance(breite, hoehe, Image.SCALE_DEFAULT);

    try {
      MediaTracker mediaTracker = new MediaTracker(new Container());
      mediaTracker.addImage(scaledImage, 0);
      mediaTracker.waitForID(0);

    } catch (InterruptedException e) {

      return null;
    }
    return scaledImage;
  }
Ejemplo n.º 2
0
    /**
     * the constructor of the class
     *
     * @param image an image
     */
    protected ImageRepresentation(Image image) {

      this.largeImage = image;
      this.smallImage =
          image.getScaledInstance(smallImageSize.width, smallImageSize.height, Image.SCALE_SMOOTH);
    }