hi,
i did it like this...
<CODE>
private void repaintImage() {
ImageIcon icon = (ImageIcon)imageLabel.getIcon();
Image img = icon.getImage();
double newWidth = img.getWidth(this) * xFactor;
double newHeight = img.getHeight(this) * yFactor;
Image scaled = img.getScaledInstance((int)newWidth, (int)newHeight, Image.SCALE_SMOOTH);
ImageIcon ii = new ImageIcon(scaled);
imageLabel.setIcon((Icon)ii);
jScrollPane1.setViewportView(imageLabel);
update(getGraphics());
}
</CODE>
i have the following structure
scrollpane contains label which contains imageIcon, this icon can be converted to awt.Image, which provides the method for scaling the image.
i suggest to reload or take a buffered image when before resizing it, because once resized, the quality drops a little bit and as often you resize you loose more quality, so always stretch or shrink the image from the original to get best quality.
hope that helps
chris