I need to resize jpeg images.
My problem is that the drawImage method doesn't
resize the image very well.
Is there a better way to resize an image, maybe
one that averages out the colour or pixels?
Cheers,
Götz
Sent via Deja.com
http://www.deja.com/
I asume that you are using ImageIcon or anything else to load the JPG.
javax.swing.ImageIcon imageIcon = new javax.swing.ImageIcon("test.jpg");
java.awt.Image newImage = imageIcon.getImage().getScaledInstance( width,
height, java.awt.Image.SCALE_AREA_AVERAGING );
Possible Scaling hints are:
java.awt.Image.SCALE_SMOOTH
java.awt.Image.SCALE_AREA_AVERAGING
...
Just have a look at the API documentation and choose yourself.
Now you can use the resized image.
Didi
<ghel...@my-deja.com> schrieb im Newsbeitrag
news:94rbg2$5ei$1...@nnrp1.deja.com...