Get Monitor Dimensions
by Mirko Hrovat
04 Mar 2008
(Updated 04 Mar 2008)
Provides the "ScreenSize" property values of the primary or secondary display(s) dynamically.
|
Watch this File
|
| File Information |
| Description |
GETMONDIM returns the dimensions of the specified monitor as a 4 element vector [xstart,ystart,width,height] where values are in pixels in the same manner that the 'ScreenSize' property provides. (xstart,ystart) are the absolute coordinates of the lower left corner. The "monitornumber" is a number associated with each monitor (Default=1). Monitor numbering is defined as the row number of the corresponding monitor in the root property 'MonitorPositions'.
The primary monitor is always numbered 1 and always starts at (1,1). 'MonitorPositions' returns coordinates corresponding to the upper left corner and the bottom right corner (Windows convention). Matlab 'Help' on this property is incorrect. GETMONDIM converts these coordinates to the Matlab convention where the lower left corner starts at (1,1). There is a feature with the root property 'ScreenSize'. If the primary monitor's resolution is adjusted after Matlab has started, then the size parameters of 'ScreenSize' are not adjusted while the origin is adjusted. GETMONDIM fixes this by using the 'ScreenSize' origin to correct for the discrepancy. Note that on restarting Matlab the 'ScreenSize' property changes to the correct values!
This file is included with Figure Management Utilities (ID 12607) and has been submitted independently as it appears that it is useful to have a dynamic and correct update of the screen coordinates. Hopefully, once this feature is fixed in Matlab, then this utility will no longer be necessary. |
| Acknowledgements |
Get Screen Size (Dynamic) and Figure Management Utilities
inspired this file.
|
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Other requirements |
This utility could be platform independent, but has not been tested on other platforms. I would be interested in hearing about your experiences by email! |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (1) |
| 05 Mar 2008 |
Brahim HAMADICHAREF
|
|
|
|
Contact us