Size of screen diagonal?

Richard Gaskin ambassador at fourthworld.com
Wed Feb 28 11:04:48 EST 2018


Peter Reid wrote:

 > I'm developing a desktop app for Mac & PC that displays photos of
 > coins. I'd like to display them at real size but I can't find the
 > properties for the current screen (i.e. the one that my app is running
 > on.  I can get the screen colour depth, resolution, scaling factor,
 > etc. but not the physical size on the screen such as "27 inch
 > diagonal" or physical px per inch.
 >
 > Can anyone tell me how to get this info, either using just LiveCode or
 > via Mac/PC shell/command scripts?

Given the wide and growing variety of screen ratios, diagonal screen 
dimensions are less useful for this task.

I think pixelDensity of what you're looking for, but be forewarned:

I spent an afternoon some time ago measuring a variety of on-screen 
elements across all the devices in my test pool, using a physical ruler 
placed on the screen.

What I found is that LC seems to do as good a job as Android itself in 
attempting to maintain consistent sizing among such a wide range of 
physical display characteristics (dot pitch, etc.).  Not surprising, 
since AFAIK LC uses the recommended OS APIs for its resolution independence.

But the downside is that I was able to measure differences in even the 
most standard elements like the status bar.  Not much, just a millimeter 
or two across some devices.

So if a fairly-close-but-not-perfect rendering will suffice, I think the 
pixelDensity function will guide your metrics.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list