How to get screen size and resolution

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
daryl
Posts: 47
Joined: Mon Apr 29, 2013 11:43 pm

How to get screen size and resolution

Post by daryl » Thu May 30, 2013 5:23 pm

Hi Folks,

I am trying to figure out if there is any way to determine the screen size and resolution. I have been looking through the documentation but have not been able to find any details on this. I have had a look at the platform, environment, processor, machine and systemVersion functions, and am wondering if there might be others I've missed that might be useful for determining the screen size. I want to write an application that will scale from smartphones to the desktop.

Any help would be greatly appreciated.

Thanks,

Daryl

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3582
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: How to get screen size and resolution

Post by mwieder » Thu May 30, 2013 5:27 pm

Try the screenrect.

daryl
Posts: 47
Joined: Mon Apr 29, 2013 11:43 pm

Re: How to get screen size and resolution

Post by daryl » Thu May 30, 2013 5:45 pm

Hi MWieder, that is just what I was looking for.

Regards,

Daryl

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10388
Joined: Fri Feb 19, 2010 10:17 am

Re: How to get screen size and resolution

Post by richmond62 » Wed Apr 08, 2026 8:06 am

That only gives you the resolution: it does NOT give you the physical screen size.

Klaus
Posts: 14311
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to get screen size and resolution

Post by Klaus » Wed Apr 08, 2026 12:29 pm

Come on, Richmond, 13 years later? 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10482
Joined: Wed May 06, 2009 2:28 pm

Re: How to get screen size and resolution

Post by dunbarx » Wed Apr 08, 2026 1:56 pm

Richmond.

13 years or not, I think the OP actually wanted what Mark suggested. After all, the physical dimensions of one's screen can only be found with a ruler, or by reading the manual that comes with the device, and that likely does not mean anything.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10388
Joined: Fri Feb 19, 2010 10:17 am

Re: How to get screen size and resolution

Post by richmond62 » Wed Apr 08, 2026 5:13 pm

I have a 27 inch iMac that I can 'dial down' to an 800 * 600 screen resolution, and I can do the same with my cathode ray tube G3 iMac . . .

So, while LC can tell me that my screenRect is 800 * 600 on both of those machines, it cannot tell me that that looks reasonable on the G3 and like a bloated haggis on the 27 inch monster.

Of course if LC could determine the maximum screen resolution of a particular display that would be jolly useful.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10482
Joined: Wed May 06, 2009 2:28 pm

Re: How to get screen size and resolution

Post by dunbarx » Wed Apr 08, 2026 9:58 pm

Richmond.

But it was never actually screen "size" that was in play. It was resolution, and I suppose if you were porting to an 85" TV at 800x600 each pixel would be about the size of a pignoli. No problem, just view the screen from 20 meters.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10388
Joined: Fri Feb 19, 2010 10:17 am

Re: How to get screen size and resolution

Post by richmond62 » Thu Apr 09, 2026 8:33 am

Let's throw in Windows pixel scaling just to stir the discussion up a bit more.

Post Reply