I don't believe that the Java 2D API has a resolution independent mapping
mode.
In order to ensure that your on-screen graphics have the size that you want,
I think you can use
Toolkit.getScreenResolution()
to get the current number of pixels per inch, then adjust your pixel
measurements accordingly.
Ted Hill
----- Original Message -----
From: "Tacci, Florence" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 24, 2001 11:06 AM
Subject: [JAVA2D] User space - device space conversion
> Hi everyone,
>
> In the Java 2D API Graphics (Sun microsystems press) book, I have read and
> understood (perhaps misunderstood) the conversion from user and device
> spaces is resolution independent, and if I draw a line of 1 cm (or
whatever
> the unit is), changing the output device, and so the resolution, will
change
> the number of used pixels but not the actual size in units (it should stay
> 1, approximatively).
> In the case I decrease my screen resolution, (so I am not in the situation
> described in the book, because I keep the same device with a different
> resolution) the line drawn looks longer. My problem is that I would like
my
> application to be independent of the screen resolution and even more, to
> represent the object at the same size on the screen, whatever its
resolution
> is. I have tried to use the normalizing transform, like described in API :
> GraphicsConfiguration gc = g.getDeviceConfiguration();
> g.setTransform(gc.getDefaultTransform());
> g.transform(gc.getNormalizingTransform());
>
> but when changing my screen resolution, the graphic object size is
modified.
> Is there a way of keeping an element size on any screen ?
>
> Thanks for your help,
>
> Florence
>
> PS: I am working on NT4.0, with jdk1.3.
>
>
===========================================================================
> 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".
>
===========================================================================
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".