Code covered by the BSD License  

Highlights from
Get screen size (dynamic)

5.0

5.0 | 4 ratings Rate this file 21 Downloads (last 30 days) File Size: 3.57 KB File ID: #10957

Get screen size (dynamic)

by Bill York

 

03 May 2006 (Updated 03 May 2006)

Same as get( 0, 'ScreenSize' ), but dynamic

| Watch this File

File Information
Description

GETSCREENSIZE Same as get( 0, 'ScreenSize' ), but dynamic
  
   SZ = GETSCREENSIZE returns a 1x4 vector of doubles giving the size of the display in pixels, in the same way as get( 0, 'ScreenSize' ), except it reads the current settings rather than reading a static copy made at MATLABĀ® startup time.

From "doc rootobject_props":

"Note that the ScreenSize property is static. Its values are read only at MATLAB startup and not updated if system display settings change."

Some applications place windows based on on the display resolution, and the resolution can change - mine does when I disconnect my laptop from my external monitor.

Acknowledgements
This submission has inspired the following:
Get Monitor Dimensions
MATLAB release MATLAB 7.2 (R2006a)
Other requirements Windows only
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
03 May 2006 Tim Farajian

Useful tool Russel. I will be using it.

02 Dec 2006 Markus Buehren

Thanks for putting that little but smart tool here!

I just would call the function GETSCREENSIZEINPIXELS to avoid any errors due to the current root units setting.

Any idea how to implement such thing under Linux?

14 Oct 2009 Lucas  
14 Oct 2009 Lucas

Good job. Thanks for this !

26 May 2010 Joseph Burgel

Thank you very much. What a PIA without this.

03 Jan 2011 Sherif Elnabarawy

very good tool . need to use it on 64 bit windows , any help ?!

06 Apr 2011 Holger

One can also use
java.awt.Toolkit.getDefaultToolkit().getScreenSize()

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
gui tools Russell Goyder 22 Oct 2008 08:24:25
example Russell Goyder 22 Oct 2008 08:24:25
screensize root rootobject display resolution Russell Goyder 22 Oct 2008 08:24:25
example Yury 16 Mar 2012 17:41:01

Contact us at files@mathworks.com