JLabel
以下のコードを使用してマップを描画する拡張クラスを取得しました。new AffineTransform()
これは、画像をそのままにしておくためのアイデンティティです (0,0,w,h)
mygraphics2D = (Graphics2D) getGraphics();
graphics2D.scale(2.0,2.0) ;
graphics2D.rotate(....
graphics2D.drawImage(myImageIcon.getImage(),new AffineTransform(), this);
JLabel
このイベントを使用してクリックすると:
public void mouseClicked(MouseEvent e) {
x =e.getX() ;
y = e.getY();
NewX = ????
NewY = ????
}
新しい座標を取得したい「スケーリング、回転...座標」を試しました
Point2D ptSrc = new Point2D.Double(x, y);
Point2D ptDst = new Point2D.Double(0, 0);
mygraphics2D.getTransform().transform(ptSrc, ptDst);
しかし、ptDstは(スケーリング、回転、..)座標とは異なります。助けてください!!!