Determine the screen DPI

Craig Newman craig at
Wed Jul 26 14:44:23 EDT 2023


The “screenrect” gives you the factor required directly. If you measure the actual width, say, of the screen and divide that into the difference between item 3 and item 1 of the screenRect, you will get the number of pixels per inch.


> On Jul 26, 2023, at 2:23 PM, Bob Sneidar via use-livecode <use-livecode at> wrote:
> Hi all.
> I am trying to convert size in inches to size in pixels given a certain monitor in use. To do that I need to obtain the DPI of the current monitor. So for example let’s say I want to set the card size to 4x6 in inches. The monitor may be 72 dpi, 96 dpi or something else depending on the resolution. Is there an LC way to do this, or will I have to use terminal to grok it? 
> Bob S
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

More information about the use-livecode mailing list