Skip to main content

[JAVA2D] 'exact' scaling

1 reply [Last post]
Anonymous

Can some one advise me:

Is it possible to draw a square to the screen that will have exact
centimeter measurements?

For example, can I draw a square that is 10 cm by 10 cm to the screen
then measure it with an 'external' ruler and verify that the
measurements are exact?

If so please give some information about the best way to do this.

Thank you,

Ted Hill

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
David Kavanagh

Ted,
To do that, you'd have to know the exact pixel spacing on your monitor.
For an LCD, that is usually pretty reasonable since the pixel sites are
fixed. For a CRT, that is not as easy since they can go out of
adjustment fairly easily. Your best bet is to come up with some sort of
calibration procedure where you draw a couple of boxes of different
sizes and ask the user to measure and enter the values. Then, in
software, you could come up with some scale factor to create your 10cm
box on the screen.

David

Thus Spoke Ted Hill:

> Can some one advise me:
>
> Is it possible to draw a square to the screen that will have exact
> centimeter measurements?
>
> For example, can I draw a square that is 10 cm by 10 cm to the screen
> then measure it with an 'external' ruler and verify that the
> measurements are exact?
>
> If so please give some information about the best way to do this.
>
> Thank you,
>
> Ted Hill
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the
> body of the message "signoff JAVA2D-INTEREST". For general help, send
> email to listserv@java.sun.com and include in the body of the message
> "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".
[att1.html]