Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-10-10 01:41:41


Joel de Guzman wrote:

>>>I'm not sure about this. Say for example that I am writing a WYSIWYG
>>>CAD application and I'd like to draw vertical and horizontal rulers.
>>>At 100% page view, I'd like the ruler to be a 1:1 with the actual
>>>screen at the designated resolution (say 72 DPI). How would I draw
>>>my ruler if the coordinates are abstracted in terms of percentage?
>>
>>
>> You mean the the rule has millimeters as the unit an at 1:1 zoom you want
>> 1 millimeter of the ruler to be 1 millimeter on the screen? Then yes,
>> you'll need some way to convert millimetres to units used on screen.
>> Though I don't understand why you want such strict equality. You won't
>> measure distances on the screen with a physical ruler anyway, right?
>
> Why not ;-) ?

You're likely to leave pretty bad looking fingertips on monitor surface ;-)

> Replace "screen" with "paper" and you'll want to
> have accurate 1:1 layouts. This is the very essence of device
> independence. If, say, I want to print a PCB (printed circuit
> board) on a 300DPI laser printer, I'd want absolute accuracy,
> otherwise, my components will not fit the holes. Device independence
> means that both "screen" and "paper" should behave identically.
> If I want 10cm on paper how can I create such a thing in an abstracted
> relative coordinate system?

You query printer DPI and paper size and use that information to convert
from millimeters that your CAD application uses to store position of holes
to pixels that the printer use.

For printer with fixed DPI and paper size you can get accurate positioning.
For screen -- well, no. First, you need to know screen size. And on CRT,
the screen size is different from image size because you can stretch the
image using analog controls. And now imagine projector device. Do you
really expect GUI buttons to have the same size on your monitor and on
projector?

> Bottom line: you'll want both absolute and relative dimensions.

That's for sure, but absolute dimensions might be needed only in specialized
applications, like CAD. And maybe can be implemented outside of GUI.

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk