Dear All,

Is there a way to retrieve the untransformed, 'absolute' co-ordinates of a
point from a transformed Graphics2D context?

For example, if I set up a BufferedImage 250x250, grab its Graphics2D
object, perform a bunch of AffineTransforms on it (translate, rotate, etc.)
and then plot a pixel at co-ordinates (0,0) that pixel will obviously not
appear, in the grand scheme of things, at 'absolute' (0,0) within the
BufferedImage as a whole. In pseudo-code...

    Image image = new BufferedImage( 250, 250 );
    Graphics2D g = image.getGraphics();
    g.translate(100,100);
    g.setPixel( 0, 0, Color.black );

...this would generate a pixel that, 'in the grand scheme of things' is
actually at point (100,100) within the BufferedImage, even though I plotted
it at point (0,0).

Is there any way I can determine what point (100,100) 'means', in
untransformed terms? I can only assume the Graphics2D object must be doing
something along these lines 'behind the scenes', but is there anyway I can
get at the equivalent 'untransformed' co-ordinate?

Many thanks in advance,

Richard.

===========================================================================
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