/** 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; }
/** * 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); }