CDC::GetDeviceCaps
intGetDeviceCaps(intnIndex**)const;**
Return Value
The value of the requested capability if the function is successful.
Parameters
nIndex
Specifies the type of information to return. It can be any one of the following values:
DRIVERVERSION Version number; for example, 0x100 for 1.0.
TECHNOLOGY Device technology. It can be any one of the following:
Value | Meaning |
DT_PLOTTER | Vector plotter |
DT_RASDISPLAY | Raster display |
DT_RASPRINTER | Raster printer |
DT_RASCAMERA | Raster camera |
DT_CHARSTREAM | Character stream |
DT_METAFILE | Metafile |
DT_DISPFILE | Display file |
HORZSIZE Width of the physical display (in millimeters).
VERTSIZE Height of the physical display (in millimeters).
HORZRES Width of the display (in pixels).
VERTRES Height of the display (in raster lines).
LOGPIXELSX Number of pixels per logical inch along the display width.
LOGPIXELSY Number of pixels per logical inch along the display height.
BITSPIXEL Number of adjacent color bits for each pixel.
PLANES Number of color planes.
NUMBRUSHES Number of device-specific brushes.
NUMPENS Number of device-specific pens.
NUMFONTS Number of device-specific fonts.
NUMCOLORS Number of entries in the device’s color table.
ASPECTX Relative width of a device pixel as used for line drawing.
ASPECTY Relative height of a device pixel as used for line drawing.
ASPECTXY Diagonal width of the device pixel as used for line drawing.
PDEVICESIZE Size of the PDEVICE internal data structure.
CLIPCAPS Clipping capabilities of the device. It can be one of the following:
Value | Meaning |
CP_NONE | Output is not clipped. |
CP_RECTANGLE | Output is clipped to rectangles. |
CP_REGION | Output is clipped to regions. |
SIZEPALETTE Number of entries in the system palette. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index.
NUMRESERVED Number of reserved entries in the system palette. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index.
COLORRES Actual color resolution of the device in bits per pixel. This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index.
RASTERCAPS Value that indicates the raster capabilities of the device. It can be a combination of the following:
Value | Meaning |
RC_BANDING | Requires banding support. |
RC_BIGFONT | Supports fonts larger than 64K. |
RC_BITBLT | Capable of transferring bitmaps. |
RC_BITMAP64 | Supports bitmaps larger than 64K. |
RC_DEVBITS | Supports device bitmaps. |
RC_DI_BITMAP | Capable of supporting the SetDIBits and GetDIBits Windows functions. |
RC_DIBTODEV | Capable of supporting the SetDIBitsToDevice Windows function. |
RC_FLOODFILL | Capable of performing flood fills. |
RC_GDI20_OUTPUT | Capable of supporting Windows version 2.0 features. |
RC_GDI20_STATE | Includes a state block in the device context. |
RC_NONE | Supports no raster operations. |
RC_OP_DX_OUTPUT | Supports dev opaque and DX array. |
RC_PALETTE | Specifies a palette-based device. |
RC_SAVEBITMAP | Capable of saving bitmaps locally. |
RC_SCALING | Capable of scaling. |
RC_STRETCHBLT | Capable of performing the StretchBlt member function. |
RC_STRETCHDIB | Capable of performing the StretchDIBits Windows function. |
- CURVECAPS The curve capabilities of the device. It can be a combination of the following:
Value | Meaning |
CC_NONE | Supports curves. |
CC_CIRCLES | Supports circles. |
CC_PIE | Supports pie wedges. |
CC_CHORD | Supports chords. |
CC_ELLIPSES | Supports ellipses. |
CC_WIDE | Supports wide borders. |
CC_STYLED | Supports styled borders. |
CC_WIDESTYLED | Supports wide, styled borders. |
CC_INTERIORS | Supports interiors. |
CC_ROUNDRECT | Supports rectangles with rounded corners. |
- LINECAPS Line capabilities the device supports. It can be a combination of the following:
Value | Meaning |
LC_NONE | Supports no lines. |
LC_POLYLINE | Supports polylines. |
LC_MARKER | Supports markers. |
LC_POLYMARKER | Supports polymarkers. |
LC_WIDE | Supports wide lines. |
LC_STYLED | Supports styled lines. |
LC_WIDESTYLED | Supports wide, styled lines. |
LC_INTERIORS | Supports interiors. |
- POLYGONALCAPS Polygonal capabilities the device supports. It can be a combination of the following:
Value | Meaning |
PC_NONE | Supports no polygons. |
PC_POLYGON | Supports alternate fill polygons. |
PC_RECTANGLE | Supports rectangles. |
PC_WINDPOLYGON | Supports winding number fill polygons. |
PC_SCANLINE | Supports scan lines. |
PC_WIDE | Supports wide borders. |
PC_STYLED | Supports styled borders. |
PC_WIDESTYLED | Supports wide, styled borders. |
PC_INTERIORS | Supports interiors. |
- TEXTCAPS Text capabilities the device supports. It can be a combination of the following:
Value | Meaning |
TC_OP_CHARACTER | Supports character output precision, which indicates the device can place device fonts at any pixel location. This is required for any device with device fonts. |
TC_OP_STROKE | Supports stroke output precision, which indicates the device can omit any stroke of a device font. |
TC_CP_STROKE | Supports stroke clip precision, which indicates the device can clip device fonts to a pixel boundary. |
TC_CR_90 | Supports 90-degree character rotation, which indicates the device can rotate characters only 90 degrees at a time. |
TC_CR_ANY | Supports character rotation at any degree, which indicates the device can rotate device fonts through any angle. |
TC_SF_X_YINDEP | Supports scaling independent of x and y directions, which indicates the device can scale device fonts separately in x and y directions. |
TC_SA_DOUBLE | Supports doubled characters for scaling, which indicates the device can double the size of device fonts. |
TC_SA_INTEGER | Supports integer multiples for scaling, which indicates the device can scale the size of device fonts in any integer multiple. |
TC_SA_CONTIN | Supports any multiples for exact scaling, which indicates the device can scale device fonts by any amount but still preserve the x and y ratios. |
TC_EA_DOUBLE | Supports double-weight characters, which indicates the device can make device fonts bold. If this bit is not set for printer drivers, GDI attempts to create bold device fonts by printing them twice. |
TC_IA_ABLE | Supports italics, which indicates the device can make device fonts italic. If this bit is not set, GDI assumes italics are not available. |
TC_UA_ABLE | Supports underlining, which indicates the device can underline device fonts. If this bit is not set, GDI creates underlines for device fonts. |
TC_SO_ABLE | Supports strikeouts, which indicates the device can strikeout device fonts. If this bit is not set, GDI creates strikeouts for device fonts. |
TC_RA_ABLE | Supports raster fonts, which indicates that GDI should enumerate any raster or TrueType fonts available for this device in response to a call to the EnumFonts or EnumFontFamilies Windows functions. If this bit is not set, GDI-supplied raster or TrueType fonts are not enumerated when these functions are called. |
TC_VA_ABLE | Supports vector fonts, which indicates that GDI should enumerate any vector fonts available for this device in response to a call to the EnumFonts or EnumFontFamilies Windows functions. This is significant for vector devices only (that is, for plotters). Display drivers (which must be able to use raster fonts) and raster printer drivers always enumerate vector fonts, because GDI rasterizes vector fonts before sending them to the driver. |
TC_RESERVED | Reserved; must be 0. |
Remarks
Retrieves a wide range of device-specific information about the display device.
Example
See the example for CPrintDialog::GetDefaults.