What is the correct method to calculate each pixel’s coordinate translation after an image is zoomed around center ? I’m using the following steps to zoom an image around it’s center :
AffineTransform atT=new AffineTransform();
int dx=img.getWidth()/2;
int dy=img.getHeight()/2;
atT.preConcatenate(AffineTransform.getTranslateInstance(-dx, -dy));
atT.preConcatenate(AffineTransform.getScaleInstance(scale, scale));
atT.preConcatenate(AffineTransform.getTranslateInstance(dx, dy));
g.drawImage(img,atT, this);
How can find out each pixel’s coordinate translation after zooming ?
Thanks,
Jay