Randy,

I've had good luck with this:

Image newImage = oldImage().getScaledInstance(scaledWidth,scaledHeight,Image.SCALE_SMOOTH));

At 04:49 PM 10/16/2002 -0500, you wrote:
I wasn't able to locate an archive to search so apologize if this is a duplicate question.
I am using an AffineTransform to make an image larger.  Unfortunately the image is blurred and not sharp or crisp as the original.
I use the same scale both for X and Y.  Is that correct?
I'm going to paste the code below.  
 
 transform.setToScale(scaleX, scaleY);
 AffineTransformOp op = new AffineTransformOp(transform, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
 Graphics2D biDestG2D = biDest.createGraphics();
 biDestG2D.clearRect(0, 0, scaledWidth, scaledHeight);
 op.filter(biSrc, biDest);
 bufImage = biDest;
Is there a way to enlarge an image and keep the quality of the image?
 
TIA for any help you can offer.  This seems like it should be fairly straight forward and I just can't get it to work.
Regards,
Randy C.
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to