Physical Screen Size

Walton Sumner wsumner at im.wustl.edu
Tue Jan 30 13:52:56 EST 2007


I have a survey instrument which can require interface elements to have
exact physical lengths, especially a "visual analog scale" that is
traditionally 10 cm. Not knowing what the screen settings will be on client
machines, I have for the time being put a button on the first screen of the
survey instrument that allows a survey administrator to drag it's right edge
until it is 2 cm long. Then anything else in the stack that needs an
absolute size can be rescaled accordingly. You can put some constraints on
the assertions, like expecting no more than 100 pixels/2cm and no less than
50 (one real value is 83 on this iMac). So far I've assumed that pixels are
squares, hope that's safe.

As long as the survey instrument resides on a given machine, this is a
one-time, set-and-forget event. The rev program reads instructions
(including VAS lengths) in text files to implement new surveys, so the
client holding the pixels/cm data should not be replaced very often.

It is not at all elegant, but I expect that the obvious variations on this
theme are pretty reliable (eg, "How long is this line?", "Click 3 cm from
the end of this line"), and perhaps less trouble for the user than asking
for several unfamiliar measurements. Still, if there is a transparent way,
I'd like to use it!

To use the info that Luis found, it seems like you would have to assert a
pagerect in a print command, then get the printscale used in printing the
page, then calculate the absolute size of the card on screen. Has anyone
tried that? 

Seems like the simplest thing to do should be to read the diagonal of used
screen space from the hardware, but I do not see a rev command to do that.
Maybe there is a shell command to read the diagonal on some systems, but I
have not found it.

Walton Sumner

> Found this under the 'print' entry in the Rev Dictionary:
> 
> 'The pageRect is the rectangle into which the card is printed, and
> consists of four integers separated by commas: the left, top, right, and
> bottom edges of the printed card, in points. (There are 72 points to an
> inch.) The card is scaled to fit the specified pageRect. If you don't
> specify a pageRect, the card's size depends on the printScale property.'
> 
> Might help in calibrating the size.
> 
> Cheers,
> 
> Luis.
> 
> 
> 
> Luis wrote:
>> Hmmm, ok. What you could then do is open a dialogue box asking for
>> dimensions (17 inch, 19 inch, etc), resolution, type (CRT, LCD or
>> Plasma) and dpi. If the dpi is unknown by the user you could try to
>> default to the most common dpi for that 'type' of monitor.
>> 
>> Cheers,
>> 
>> Luis.
>> 
>> 
>> Mark Schonewille wrote:
>>> Hi Luis,
>>> 
>>> Yup, my main monitor is of the brand "unknown".
>>> 
>>> Mark
>>> 
>>> -- 
>>> 
>>> Economy-x-Talk
>>> Consultancy and Software Engineering
>>> http://economy-x-talk.com
>>> http://www.salery.biz
>>> 
>>> Get your store on-line within minutes with Salery Web Store software.
>>> Download at http://www.salery.biz
>>> 
>>> Op 19-jan-2007, om 17:00 heeft Luis het volgende geschreven:
>>> 
>>>> Hiya,
>>>> 
>>>> If you can determine the monitor type you could probe a database of
>>>> configurations/resolution/dpi settings etc and then calculate the
>>>> image size (using its coordinates) based on this information.
>>>> I haven't looked into this but I reckon OSX and WXP have these in the
>>>> system somewhere (so they can 'plug and play').
>>>> 
>>>> 
>>>> Cheers,
>>>> 
>>>> Luis.




More information about the use-livecode mailing list