Hi Ted,

The typical way that I do this kind of "transforming about a point
other than the origin" is:

        imgx = imgw/2;
        imgy = imgh/2;
        translate(imgx, imgy);
        scale(scalex, scaley);
        translate(-imgx, -imgy);

That lets the transform object do the calculations for you.  Actually
to ensure that the image is always centered in the panel even if it
doesn't match the size of the image, I would do:

        translate(panelw/2.0, panelh/2.0);
        scale(scalex, scaleh);
        translate(-imgw/2.0, -imgh/2.0);

                                ...jim

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