Hi Michalis,
The drawImage calls are not specified to do anything better than
nearest neighbor scaling algorithms in JDK 1.1 (in Java 2 there are
some rendering hints that can affect algorithm choice). If you want
a higher quality scaling of the image, then you have two choices:
- Use the AreaAveragingScaleFilter with a FilteredImageSource
to produce a new image that is scaled with a reasonably high
quality scaling filter.
- Use the Image.getScaledInstance() method to get a new image
similar to the above, but probably easier to invoke. You will
want to use the SCALE_SMOOTH or SCALE_AVERAGE hint with that
method(*).
In Java 2, you can do everything you want a little easier using a
BufferedImage and an AffineTransformOp both of which operate immediately
and directly on the pixels unlike the asynchronous operations provided
in JDK 1.1 - but then you are tied to a Java 2 runtime.
...jim
(*) - The SCALE_AVERAGE hint specifically chooses the algorithm specified
by the AreaAveragingScaleFilter whereas the SCALE_SMOOTH hint chooses any
smooth scaling algorithm and could be accelerated on a platform that has a
pretty quick Bilinear image scaling facility. The quality of the results
with SCALE_SMOOTH is open to interpretation by the implementation, but it
should be much better than the results you are currently seeing whatever
algorithm is chosen.
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/