@Override public Point2D getPoint2D(final Point2D srcPt, final Point2D dstPt) { return delegate.getPoint2D(srcPt, dstPt); }
@Override public Point2D getPoint2D(final Point2D srcPt, final Point2D dstPt) { return delegate.getPoint2D(srcPt, dstPt); }
BufferedImage img1 = new BufferedImage(200, 100, BufferedImage.TYPE_INT_ARGB); BufferedImage img2 = new BufferedImage(400, 200, BufferedImage.TYPE_INT_ARGB); double sx = img2.getWidth() / (double) img1.getWidth(); double sy = img2.getHeight() / (double) img1.getHeight(); AffineTransformOp xform = new AffineTransformOp(AffineTransform.getScaleInstance(sx, sy), null); Point srcPt = new Point(7, 49); Point dstPoint = (Point) xform.getPoint2D(srcPt, new Point()); System.err.println("srcPt: " + srcPt); System.err.println("dstPoint: " + dstPoint);
AffineTransform tx = new AffineTransform(); tx.rotate(3.14/5, img.getWidth() / 2, img.getHeight() / 2); AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR); BufferedImage img2 = op.filter(img, null); g2.drawImage(img, 0, 0, null); g2.drawImage(img2, 0, 0, null); g2.setColor(Color.magenta); Point2D.Double p2=(Point2D.Double)op.getPoint2D(new Point2D.Double(10, hc/2), null); g2.fillOval(10, hc/2, 5, 5); g2.setColor(Color.red); g2.fillOval((int)p2.x, (int)p2.y, 5, 5); System.out.println(p2.toString());