getmondim
GET MONitor DIMensions.
Contents
Syntax
y = getmondim(monitornumber)
Description
"y" is the dimensions of the specified monitor represented as [xstart,ystart,width,height] where values are in pixels. (xstart,ystart) are the absolute coordinates of the lower left corner.
"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!
Examples:
y=getmondim;
y=getmondim(2);
- Copyright 2006 Mirtech, Inc. created 09/26/2006 by Mirko Hrovat on Matlab Ver. 7.2
email: mhrovat@email.com