Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

GetDeviceCaps (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function retrieves information about the capabilities of a specified device.

int GetDeviceCaps(
  HDC hdc, 
  int nIndex
);

Parameters

hdc
[in] Handle to the device context.
nIndex
[in] Specifies the item to return.

This parameter can be one of the following values.

ValueDescription
ASPECTXRelative width of a device pixel used for line drawing.
ASPECTXYDiagonal width of the device pixel used for line drawing.
ASPECTYRelative height of a device pixel used for line drawing.
BITSPIXELNumber of adjacent color bits for each pixel.
CLIPCAPSFlag that indicates the clipping capabilities of the device.

If the device can clip to a rectangle, it is 1. Otherwise, it is 0.

COLORRESActual 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 and is available only if the driver is compatible with 16-bit Windows.

CURVECAPSValue that indicates the curve capabilities of the device, as shown in the following list:
 CC_CHORDDevice can draw chord arcs.
 CC_CIRCLESDevice can draw circles.
 CC_ELLIPSESDevice can draw ellipses.
 CC_INTERIORSDevice can draw interiors.
 CC_NONEDevice does not support curves.
 CC_PIEDevice can draw pie wedges.
 CC_ROUNDRECTDevice can draw rounded rectangles.
 CC_STYLEDDevice can draw styled borders.
 CC_WIDEDevice can draw wide borders.
 CC_WIDESTYLEDDevice can draw borders that are wide and styled.
DRIVERVERSIONThe device driver version.
HORZRESWidth, in pixels, of the screen.
HORZSIZEWidth, in millimeters, of the physical screen.
LINECAPSValue that indicates the line capabilities of the device, as shown in the following list:
 LC_INTERIORSDevice can draw interiors.
 LC_MARKERDevice can draw a marker.
 LC_NONEDevice does not support lines.
 LC_POLYLINEDevice can draw a polyline.
 LC_POLYMARKERDevice can draw multiple markers.
 LC_STYLEDDevice can draw styled lines.
 LC_WIDEDevice can draw wide lines.
 LC_WIDESTYLEDDevice can draw lines that are wide and styled.
LOGPIXELSXNumber of pixels per logical inch along the screen width.

In a system with multiple display monitors, this value is the same for all monitors.

LOGPIXELSYNumber of pixels per logical inch along the screen height.

In a system with multiple display monitors, this value is the same for all monitors.

NUMBRUSHESNumber of device-specific brushes.
NUMCOLORSNumber of entries in the device's color table, if the device has a color depth of no more than 8 bits per pixel.

For devices with greater color depths, –1 is returned.

NUMFONTSNumber of device-specific fonts.
NUMPENSNumber of device-specific pens.
NUMRESERVEDNumber 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 and is available only if the driver is compatible with 16-bit Windows.

PDEVICESIZEReserved.
PHYSICALHEIGHTFor printing devices: the height of the physical page, in device units.

For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical height value of 6600 device units.

The physical page is almost always greater than the printable area of the page, and never smaller.

Windows CE 1.0 and 1.01 do not support this value.

PHYSICALOFFSETXFor printing devices: the distance from the left edge of the physical page to the left edge of the printable area, in device units.

For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the leftmost 0.25" of paper, has a horizontal physical offset of 150 device units.

Windows CE 1.0 and 1.01 do not support this value.

PHYSICALOFFSETYFor printing devices: the distance from the top edge of the physical page to the top edge of the printable area, in device units.

For example, a printer set to print at 600 dpi on 8.5"x11" paper, that cannot print on the topmost 0.5" of paper, has a vertical physical offset of 300 device units.

Windows CE 1.0 and 1.01 do not support this value.

PHYSICALWIDTHFor printing devices: the width of the physical page, in device units.

For example, a printer set to print at 600 dpi on 8.5"x11" paper has a physical width value of 5100 device units.

The physical page is almost always greater than the printable area of the page, and never smaller.

Windows CE 1.0 and 1.01 do not support this value.

PLANESNumber of color planes.
POLYGONALCAPSValue that indicates the polygon capabilities of the device, as shown in the following list:
 PC_INTERIORSDevice can draw interiors.
 PC_NONEDevice does not support polygons.
 PC_POLYGONDevice can draw alternate-fill polygons.
 PC_RECTANGLEDevice can draw rectangles.
 PC_SCANLINEDevice can draw a single scanline.
 PC_STYLEDDevice can draw styled borders.
 PC_WIDEDevice can draw wide borders.
 PC_WIDESTYLEDDevice can draw borders that are wide and styled.
 PC_WINDPOLYGONDevice can draw winding-fill polygons.
RASTERCAPSValue that indicates the raster capabilities of the device, as shown in the following list:
 RC_BANDINGRequires banding support.
 RC_BITBLTCapable of transferring bitmaps.
 RC_BITMAP64Capable of supporting bitmaps larger than 64K.
 RC_DI_BITMAPCapable of supporting device independent bitmaps.
 RC_DIBTODEVUnsupported.
 RC_GDI20_OUTPUTCapable of supporting features of 16-bit Windows 2.0.
 RC_PALETTESpecifies a palette-based device.
 RC_SCALINGCapable of scaling.
 RC_STRETCHBLTUnsupported.
 RC_STRETCHDIBUnsupported.
SHADEBLENDCAPSValue that indicates the shading and blending capabilities of the device. See Remarks for further comments.
 SB_CONST_ALPHAHandles the SourceConstantAlpha member of the BLENDFUNCTION structure, which is referenced by the blendFunction parameter of the AlphaBlend function.
 SB_GRAD_RECTCapable of handling GradientFill rectangles.
 SB_GRAD_TRICapable of handling GradientFill triangles.
 0Device does not support any of these capabilities.
 SB_PIXEL_ALPHACapable of handling per-pixel alpha in AlphaBlend.
 SB_PREMULT_ALPHACapable of handling premultiplied alpha in AlphaBlend.
SIZEPALETTENumber of entries in the system palette.

This index is valid only if the device driver sets the RC_PALETTE bit in the RASTERCAPS index and is available only if the driver is compatible with 16-bit Windows.

TECHNOLOGYDevice technology. It can be any one of the following values.
 DT_PLOTTERVector plotter
 DT_RASDISPLAYRaster display
 DT_RASPRINTERRaster printer
 DT_RASCAMERARaster camera
 DT_CHARSTREAMCharacter stream
 DT_DISPFILEDisplay file
TEXTCAPSValue that indicates the text capabilities of the device, as shown in the following list:
 TC_CP_STROKEDevice is capable of stroke clip precision.
 TC_CR_90Device is capable of 90-degree character rotation.
 TC_CR_ANYDevice is capable of any character rotation.
 TC_EA_DOUBLEDevice can draw double-weight characters.
 TC_IA_ABLEDevice can italicize.
 TC_OP_CHARACTERDevice is capable of character output precision.
 TC_OP_STROKEDevice is capable of stroke output precision.
 TC_RA_ABLEDevice can draw raster fonts.
 TC_RESERVEDReserved; must be zero.
 TC_SA_CONTINDevice uses any multiples for exact character scaling.
 TC_SA_DOUBLEDevice is capable of doubled character for scaling.
 TC_SA_INTEGERDevice uses integer multiples only for character scaling.
 TC_SCROLLBLTDevice cannot scroll using a bit-block transfer.

This meaning may be the opposite of what you expect.

 TC_SF_X_YINDEPDevice can scale independently in the x- and y-directions.
 TC_SO_ABLEDevice can draw strikeouts.
 TC_UA_ABLEDevice can underline.
 TC_VA_ABLEDevice can draw vector fonts.
VERTRESHeight, in raster lines, of the screen.
VERTSIZEHeight, in millimeters, of the physical screen.

Return Values

Returns the value of the desired item.

Remarks

The following table shows the six indexes that GetDeviceCaps provides in place of printer escapes.

IndexPrinter escape replaced
PHYSICALWIDTHGETPHYSPAGESIZE
PHYSICALHEIGHTGETPHYSPAGESIZE
PHYSICALOFFSETXGETPRINTINGOFFSET
PHYSICALOFFSETYGETPHYSICALOFFSET

Windows CE 1.0 and 1.01 do not support these indexes.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Windows.h.
Link Library: Coredll.lib.

See Also

GetObjectType | StretchBlt | GDI Functions


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2015 Microsoft