Returns information about the current output device.
% = GetDevCaps(n%)
n%:integer expression
GetDevCaps returns information such as the screen resolution, number of colors etc. After the function call the information is returned in c%. The type of desired information is specified in n%, where n% can assume one of the following values:
n% = 0 or DRIVERVERSION - returns the driver version number
n% = 2 or TECHNOLOGY - returns the type of output device as follows:
c% = 1 or DT_RASDISPLAY | Raster display (screen) | |
c% = 2 or DT_RASPRINTER | Raster printer (dot matrix printer) | |
c% = 3 or DT_RASCAMERA | Raster camera (screen photo or similar) | |
c% = 4 or DT_CHARSTREAM | Character stream (e.g. file) | |
c% = 5 or DT_METAFILE | Metafile (.WMF) | |
c% = 6 or DT_DISPFILE | Display file (cards ??) |
n% = 4 or HORZSIZE - Width of physical display in mm
n% = 6 or VERTSIZE - Height of physical display in mm
n% = 8 or HORZRES - Width of physical display in pixels
n% = 10 or VERTRES - Height of physical display in pixels
n% = 88 or LOGPIXELSX - Number of pixels per logical inch on the x-axis (horizontal DPI resolution)
n% = 90 or LOGPIXELSY - Number of pixels per logical inch on the y-axis (vertical DPI resolution)
n% = 12 or BITSPIXEL - Number of bits per pixel
n% = 14 or PLANES - Number or color planes
n% = 16 or NUMBRUSHES - Number of device specific fill patterns (Brushes)
n% = 18 or NUMPENS - Number of device specific line styles (Pens)
n% = 22 or NUMFONTS - Number of device specific fonts
n% = 24 or NUMCOLORS - Number of available colors
n% = 40 or ASPECTX - relative width of a pixel for lines
n% = 42 or ASPECTY - relative height of a pixel for lines
n% = 44 or ASPECTXY - diagonal size of a pixel for lines
n% = 26 or PDEVICESIZE - size of internal data structure (PDEVICE)
n% = 36 or CLIPCAPS - indicates if the output device can perform rectangle clipping. c% = 1 for yes or 0 for no
n% = 104 or SIZEPALETTE - Number of colors in the system palette
n% = 106 or NUMRESERVED - Number of reserved entries in the system palette
n% = 108 or COLORRES - Color resolution in bits per pixel
n% = 38 or RASTERCAPS - A word of information about the capabilities of the output device to display raster graphics. The following values are possible:
c% = 2 or RC_BANDING | requires banding (printer - Escape NEWBAND) | |
c% = 4 or RC_SCALING | allows scaling | |
c% = 8 or RC_BITMAP64 | allows bitmaps of more than 64 KBytes | |
c% = $0010 or RC_GDI20_OUTPUT | allows Windows 2.0 functions | |
c% = $0080 or RC_DI_BITMAP | allows GetDIBits and SetDIBits | |
c% = $0100 or RC_PALETTE | contains a palette | |
c% = $0200 or RC_DIBTODEV | allows DIBitsToDevice | |
c% = $0800 or RC_STRETCHBLT | allows StretchBlt | |
c% = $2000 or RC_STRETCHDIB | allows StretchDIBits |
n% = 28 or CURVECAPS - A word of information about the capabilities of output devices to display curves. A set bit indicates the following:
0 - Circle 1 - Arc 2 - Arc 3 - Ellipse 4 - Wide lines 5 - Line style 6 - Wide line style |
n% = 30 or LINECAPS - A word of information about the capabilities of output devices to display line styles. A set bit indicates the following:
1 - Polylines 4 - Wide Lines 5 - Line styles 6 - Wide line styles 7 - Solid area (Plotters can't do this) |
n% = 32 or POLYGONALCAPS - A word of information about the capabilities of output devices to display polygons. A set bit indicates the following:
0 - Alternating fill mode 1 - Rectangle 2 - Winding fill mode 3 - Scan line 4 - Wide line 5 - Line style 6 - Wide line style 7 - Internal area |
n% = 34 or TEXTCAPS - A word of information about the capabilities of output devices to display text. A set bit indicates the following:
0 - Character positioning 1 - Stroke positioning (exact) 2 - Stroke clipping (exact) 3 - Character rotation in 90° steps 4 - Arbitrary character rotation 5 - Separate x and y scaling 6 - Double characters for scaling 7 - Integer scaling 8 - Arbitrary scaling 9 - Double width characters 10 - Italics 11 - Underline 12 - Strike out 13 - Bitmap fonts (Raster fonts) 14 - Vector fonts 15 - reserved 0 |
OpenW # 1
Print GetDevCaps(HORZRES)
Print GetDevCaps(VERTRES)
prints the horizontal and vertical screen resolution in pixels.
GetDevCaps() corresponds to the Windows API function GetDeviceCaps().
Most of the information can be obtained using the Screen object or App object.
{Created by Sjouke Hamstra; Last updated: 07/10/2014 by James Gaite}