ScreenRes
ScreenRes Obtain screen resolution in pixels-per-inch short *horizPPI ; address to receive horizontal resolution
short *vertPPI ; address to receive vertical resolution
ScreenRes lets you obtain the screen resolution in pixels-per-inch. It can be useful in scaling objects to make maximum use of the screen real estate.
horizPPI and . . .
vertPPI are the addresses of a 16-bit integers. Upon return, they will
contain the screen resolution, expressed in pixels-per-inch.
Notes: This function just copies the values of the low-memory variables ScrHRes and ScrVRes to your own variables. The addresses of these variables are defined in Quickdraw.h. Thus, ScreenRes is functionally equivalent to: horizPPI = ScrHRes;
vertPPI = ScrVRes;
A more-often needed value is the total size of the screen, in pixels. Obtain
that by reading the bounds field from the screenBits BitMap:
horizPixels = screenBits.bounds.right;
vertPixels = screenBits.bounds.bottom;
The global variable, GrayRgn (a RgnHandle) describes the size and shape of the desktop. This is especially handy to take advantage of Macs that have
more than one screen.