Thanks scuriware:
It does not change: I can see the images very warped
look at the pdfs attached:
one is with Resize and AffineTrafsorm
another is with getScaledInstance
the third one is obtained with oruntAll directly on the printer where the Graphics2D is scaled. This is GOOD for image (as you can see) but not good for text because typographic points are not respected.
Any suggestion ?
Thanks a lot
Main Topics
Browse All Topics





by: sciuriwarePosted on 2009-01-12 at 10:51:53ID: 23356036
I use this method, although very simple, but it works for me.
B yFactor); mer, AffineTransformOp.TYPE_BIL INEAR); oolkit().c reateImage (buffer.ge tSource()) );
May be you can extend it to your needs?
/**
* Resizes an Image by stretching it to a new size by x factor and y factor.
*
* @param picture the initial image.
* @param xFactor the width stretching factor.
* @param yFactor the height stretching factor.
* @return the stretched image.
*/
public static Image resize(Image picture, double xFactor, double yFactor)
{
BufferedImage buffer;
Graphics2D g;
AffineTransform transformer;
AffineTransformOp operation;
buffer = new BufferedImage
(
picture.getWidth(null),
picture.getHeight(null),
BufferedImage.TYPE_INT_ARG
);
g = buffer.createGraphics();
g.drawImage(picture, 0, 0, null);
transformer = new AffineTransform();
transformer.scale(xFactor,
operation = new AffineTransformOp(transfor
buffer = operation.filter(buffer, null);
return(Toolkit.getDefaultT
}
;JOOP!