网站首页  词典首页

请输入您要查询的函数:

 

术语 getdevicecaps
释义 GetDeviceCaps
语法:
int GetDeviceCaps(
__in HDC hdc,
__in int nIndex
);
GetDeviceCaps函数
GetDeviceCaps函数检索设备指定设备的具体资料。
参数
hdc [in]
句柄到DC。
nIndex [in]
该项目要返回。此参数可以是下列值之一。
IndexMeaning
DRIVERVERSIONThe设备驱动程序版本。
TECHNOLOGYDevice技术。它可以是任何下列值之一。
DT_PLOTTERVector绘图仪
DT_RASDISPLAYRaster显示
DT_RASPRINTERRaster打印机
DT_RASCAMERARaster相机
DT_CHARSTREAMCharacter流
DT_METAFILEMetafile
DT_DISPFILEDisplay文件

如果参数的HDC句柄是一个增强型图元区,设备技术是被引用装置,并指定给CreateEnhMetaFile功能。以确定它是否是一个增强型图元区,使用GetObjectType功能。
HORZSIZEWidth,以毫米为单位,在物理屏幕。
VERTSIZEHeight,以毫米为单位,在物理屏幕。
HORZRESWidth,在像素,屏幕或打印机,宽度,以像素为页面的可打印区域。
VERTRESHeight,在光栅线,屏幕或打印机的高度,以像素,在页面的可打印区域。
每逻辑英寸像素LOGPIXELSXNumber沿着屏幕的宽度。在一个多显示器系统,该值是所有显示器相同。
每逻辑英寸像素LOGPIXELSYNumber沿着屏幕的高度。在一个多显示器系统,该值是所有显示器相同。
BITSPIXELNumber每个像素相邻的颜色位。
PLANESNumber彩色飞机。
NUMBRUSHESNumber的设备特定的刷子。
NUMPENSNumber的设备特定的笔。
NUMFONTSNumber的设备特定的字体。
NUMCOLORSNumber的条目在器件的颜色表,如果该设备有一个不超过每像素8位的颜色深度。对于设备的色深,则返回1。
ASPECTXRelative宽度为线描用设备像素。
ASPECTYRelative高度的线描使用的设备像素。
ASPECTXYDiagonal宽度的线条画所用的设备像素。
PDEVICESIZEReserved。
CLIPCAPSFlag,表明该设备的剪辑功能。如果该设备能剪辑一个矩形,它是1。否则,它是0。
参赛作品的SIZEPALETTENumber在系统调色板。该指数是有效的只有当设备驱动程序设置在RASTERCAPS指数RC_PALETTE位,并且仅当驱动程序与16位Windows兼容。
NUMRESERVEDNumber在系统调色板保留项目。该指数是有效的只有当设备驱动程序设置在RASTERCAPS指数RC_PALETTE位,并且仅当驱动程序与16位Windows兼容。
该设备COLORRESActual色彩分辨率,每像素的位数。该指数是有效的只有当设备驱动程序设置在RASTERCAPS指数RC_PALETTE位,并且仅当驱动程序与16位Windows兼容。
PHYSICALWIDTHFor打印设备:对物理页面宽度,设备单位。例如,一台打印机设置为打印600 8.5 - x11的分辨率英寸的文件有一个5100的物理设备单位宽度值。请注意,物理页几乎总是比页面可打印区域更大,永不小。
PHYSICALHEIGHTFor打印设备:对物理页的高度,以设备单位。例如,一台打印机设置为打印600 8.5分辨率× 11英寸的文件有一个6600设备单位的物理高度值。请注意,物理页几乎总是比页面可打印区域更大,永不小。
PHYSICALOFFSETXFor打印设备:从物理页面左侧边缘距离可打印区域的左边缘,设备单位。例如,一台打印机设置为600 dpi的打印8.5按11英寸的纸,不能打印在最左边的0.25英寸的纸张,有Level的物理设备单位的150所抵消。
PHYSICALOFFSETYFor打印设备:从物理页的顶部边缘距离可打印区域的顶部边缘,设备单位。例如,一台打印机设置为600 dpi的打印8.5按11英寸的纸,不能打印的最顶层0.5英寸的纸张,有一个垂直的物理设备单位的300所抵消。
VREFRESHFor显示设备:当前设备的垂直刷新率,在周期每秒(赫兹)。
垂直刷新速率值为0或1代表显示硬件的默认刷新率。此默认率通常是由开关上的显示卡或计算机主板,或通过配置程序,不使用诸如ChangeDisplaySettings显示功能。
SCALINGFACTORXScaling进行X打印机的轴因素。
SCALINGFACTORYScaling用于Y因素打印机的轴心。
BLTALIGNMENTPreferred平拉对齐,作为一个像素多表示。为了获得最佳绘图性能,窗户应为Level对齐此值的倍数。值为零表示设备的加速,任何调整都可以使用。
SHADEBLENDCAPSValue,指示阴影和混合设备的能力。见备注进一步的评论。
SB_CONST_ALPHAHandles的BLENDFUNCTION结构,它是由AlphaBlend函数blendFunction参数引用SourceConstantAlpha成员。
SB_GRAD_RECTCapable做渐变的矩形。
SB_GRAD_TRICapable做渐变三角形。
SB_NONEDevice不支持这些功能的。
SB_PIXEL_ALPHACapable处理每次在AlphaBlend像素阿尔法。
SB_PREMULT_ALPHACapable处理预乘在AlphaBlend阿尔法。

RASTERCAPSValue,表明该设备的光栅功能,如下表所示。
RC_BANDINGRequires带支持。
RC_BITBLTCapable转让位图。
RC_BITMAP64Capable支持大于64 KB的位图。
RC_DI_BITMAPCapable的支持SetDIBits和GetDIBits功能。
RC_DIBTODEVCapable的支持SetDIBitsToDevice函数。
履行洪水RC_FLOODFILLCapable填充。
RC_PALETTESpecifies调色板的设备。
RC_SCALINGCapable的缩放。
RC_STRETCHBLTCapable的执行StretchBlt功能。
RC_STRETCHDIBCapable的StretchDIBits履行职能。

CURVECAPSValue,表明该设备的曲线功能,如下表所示。
CC_NONEDevice不支持曲线。
CC_CHORDDevice可以借鉴弦弧。
CC_CIRCLESDevice可以借鉴界。
CC_ELLIPSESDevice可以借鉴省略号。
CC_INTERIORSDevice可以利用内部。
CC_PIEDevice可以借鉴扇形。
CC_ROUNDRECTDevice可以借鉴圆角矩形。
CC_STYLEDDevice可以借鉴风格的边界。
CC_WIDEDevice可以利用广泛的边界。
CC_WIDESTYLEDDevice可以利用边境地区广泛,风格。

LINECAPSValue,表明该设备线功能,如下表所示:
LC_NONEDevice不支持线。
LC_INTERIORSDevice可以利用内部。
LC_MARKERDevice可以得出一个标志。
LC_POLYLINEDevice可以得出一个折线。
LC_POLYMARKERDevice可以借鉴多个标记。
LC_STYLEDDevice可以借鉴风格的线条。
LC_WIDEDevice可以借鉴宽线。
LC_WIDESTYLEDDevice可以借鉴行广泛,风格。

POLYGONALCAPSValue,表明该设备的多边形的能力,如下表所示。
PC_NONEDevice不支持多边形。
PC_INTERIORSDevice可以利用内部。
PC_POLYGONDevice可以借鉴其他填充多边形。
PC_RECTANGLEDevice可以绘制矩形。
PC_SCANLINEDevice可以利用一个单一的扫描线。
PC_STYLEDDevice可以借鉴风格的边界。
PC_WIDEDevice可以利用广泛的边界。
PC_WIDESTYLEDDevice可以利用边境地区广泛,风格。
PC_WINDPOLYGONDevice可以借鉴清盘填充多边形。

TEXTCAPSValue,表明该设备的文本功能,如下表所示。
TC_OP_CHARACTERDevice能够字符输出精度。
TC_OP_STROKEDevice能够中风的输出精度。
TC_CP_STROKEDevice能够中风剪辑精度。
TC_CR_90Device能够90度字符旋转。
TC_CR_ANYDevice能够任意字符的旋转。
TC_SF_X_YINDEPDevice可以扩展独立在x和y方向。
TC_SA_DOUBLEDevice能够为扩大一倍字符。
TC_SA_INTEGERDevice只使用的字符缩放的整数倍。
TC_SA_CONTINDevice使用任何确切的字符缩放倍数。
TC_EA_DOUBLEDevice可以借鉴双体重字符。
TC_IA_ABLEDevice可以斜体。
TC_UA_ABLEDevice可以见证。
TC_SO_ABLEDevice可以借鉴三振。
TC_RA_ABLEDevice可以借鉴光栅字体。
TC_VA_ABLEDevice可以利用矢量字体。
TC_RESERVEDReserved;必须为零。
TC_SCROLLBLTDevice不能滚动使用位块传输。请注意,此含义可能是您所期望相反。

COLORMGMTCAPSValue,表明该设备的色彩管理功能。
CM_CMYK_COLORDevice可以接受CMYK色彩空间的ICC色彩配置文件。
CM_DEVICE_ICMDevice可以对无论是设备驱动程序或设备本身的ICM的。
CM_GAMMA_RAMPDevice支持GetDeviceGammaRamp和SetDeviceGammaRamp
CM_NONEDevice不支持ICM的。

返回值
返回值指定所需物品的价值。
当nIndex是BITSPIXEL和设备已15bpp或16bpp,返回值是16。
备注
当nIndex是SHADEBLENDCAPS:
对于一台打印机,无论GetDeviceCaps返回打印机的报告。
对于显示设备,所有的混合操作提供;除了SB_NONE,唯一的返回值SB_CONST_ALPHA和SB_PIXEL_ALPHA,这表明这些行动是否是加速。
在一个多监视器系统中,如果hdc是桌面,然后GetDeviceCaps返回主监视器的功能。
GetDeviceCaps提供了逃跑的打印机之后举行六个指标。
IndexPrinter逃避取代
PHYSICALWIDTHGETPHYSPAGESIZE
PHYSICALHEIGHTGETPHYSPAGESIZE
PHYSICALOFFSETXGETPRINTINGOFFSET
PHYSICALOFFSETYGETPHYSICALOFFSET
SCALINGFACTORXGETSCALINGFACTOR
SCALINGFACTORYGETSCALINGFACTOR
实例
有关示例,请参阅准备打印。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
设备上下文概述
设备上下文函数
CreateEnhMetaFile
CreateIC
DeviceCapabilities
GetDIBits
GetObjectType
SetDIBits
SetDIBitsToDevice
StretchBlt
StretchDIBits函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetDeviceCaps Function
The GetDeviceCaps function retrieves device-specific information for the specified device.
Syntax
int GetDeviceCaps(
__in HDC hdc,
__in int nIndex
);
Parameters
hdc [in]
A handle to the DC.
nIndex [in]
The item to be returned. This parameter can be one of the following values.
IndexMeaning
DRIVERVERSIONThe device driver version.
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_METAFILEMetafile
DT_DISPFILEDisplay file

If the hdc parameter is a handle to the DC of an enhanced metafile, the device technology is that of the referenced device as specified to the CreateEnhMetaFile function. To determine whether it is an enhanced metafile DC, use the GetObjectType function.
HORZSIZEWidth, in millimeters, of the physical screen.
VERTSIZEHeight, in millimeters, of the physical screen.
HORZRESWidth, in pixels, of the screen; or for printers, the width, in pixels, of the printable area of the page.
VERTRESHeight, in raster lines, of the screen; or for printers, the height, in pixels, of the printable area of the page.
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.
BITSPIXELNumber of adjacent color bits for each pixel.
PLANESNumber of color planes.
NUMBRUSHESNumber of device-specific brushes.
NUMPENSNumber of device-specific pens.
NUMFONTSNumber of device-specific fonts.
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.
ASPECTXRelative width of a device pixel used for line drawing.
ASPECTYRelative height of a device pixel used for line drawing.
ASPECTXYDiagonal width of the device pixel used for line drawing.
PDEVICESIZEReserved.
CLIPCAPSFlag that indicates the clipping capabilities of the device. If the device can clip to a rectangle, it is 1. Otherwise, it is 0.
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.
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.
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.
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-inch paper has a physical width value of 5100 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.
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-by-11-inch paper has a physical height value of 6600 device units. Note that the physical page is almost always greater than the printable area of the page, and never smaller.
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-by-11-inch paper, that cannot print on the leftmost 0.25-inch of paper, has a horizontal physical offset of 150 device units.
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-by-11-inch paper, that cannot print on the topmost 0.5-inch of paper, has a vertical physical offset of 300 device units.
VREFRESHFor display devices: the current vertical refresh rate of the device, in cycles per second (Hz).
A vertical refresh rate value of 0 or 1 represents the display hardware's default refresh rate. This default rate is typically set by switches on a display card or computer motherboard, or by a configuration program that does not use display functions such as ChangeDisplaySettings .
SCALINGFACTORXScaling factor for the x-axis of the printer.
SCALINGFACTORYScaling factor for the y-axis of the printer.
BLTALIGNMENTPreferred horizontal drawing alignment, expressed as a multiple of pixels. For best drawing performance, windows should be horizontally aligned to a multiple of this value. A value of zero indicates that the device is accelerated, and any alignment may be used.
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 doing GradientFill rectangles.
SB_GRAD_TRICapable of doing GradientFill triangles.
SB_NONEDevice 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.

RASTERCAPSValue that indicates the raster capabilities of the device, as shown in the following table.
RC_BANDINGRequires banding support.
RC_BITBLTCapable of transferring bitmaps.
RC_BITMAP64Capable of supporting bitmaps larger than 64 KB.
RC_DI_BITMAPCapable of supporting the SetDIBits and GetDIBits functions.
RC_DIBTODEVCapable of supporting the SetDIBitsToDevice function.
RC_FLOODFILLCapable of performing flood fills.
RC_PALETTESpecifies a palette-based device.
RC_SCALINGCapable of scaling.
RC_STRETCHBLTCapable of performing the StretchBlt function.
RC_STRETCHDIBCapable of performing the StretchDIBits function.

CURVECAPSValue that indicates the curve capabilities of the device, as shown in the following table.
CC_NONEDevice does not support curves.
CC_CHORDDevice can draw chord arcs.
CC_CIRCLESDevice can draw circles.
CC_ELLIPSESDevice can draw ellipses.
CC_INTERIORSDevice can draw interiors.
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.

LINECAPSValue that indicates the line capabilities of the device, as shown in the following table:
LC_NONEDevice does not support lines.
LC_INTERIORSDevice can draw interiors.
LC_MARKERDevice can draw a marker.
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.

POLYGONALCAPSValue that indicates the polygon capabilities of the device, as shown in the following table.
PC_NONEDevice does not support polygons.
PC_INTERIORSDevice can draw interiors.
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.

TEXTCAPSValue that indicates the text capabilities of the device, as shown in the following table.
TC_OP_CHARACTERDevice is capable of character output precision.
TC_OP_STROKEDevice is capable of stroke output precision.
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_SF_X_YINDEPDevice can scale independently in the x- and y-directions.
TC_SA_DOUBLEDevice is capable of doubled character for scaling.
TC_SA_INTEGERDevice uses integer multiples only for character scaling.
TC_SA_CONTINDevice uses any multiples for exact character scaling.
TC_EA_DOUBLEDevice can draw double-weight characters.
TC_IA_ABLEDevice can italicize.
TC_UA_ABLEDevice can underline.
TC_SO_ABLEDevice can draw strikeouts.
TC_RA_ABLEDevice can draw raster fonts.
TC_VA_ABLEDevice can draw vector fonts.
TC_RESERVEDReserved; must be zero.
TC_SCROLLBLTDevice cannot scroll using a bit-block transfer. Note that this meaning may be the opposite of what you expect.

COLORMGMTCAPSValue that indicates the color management capabilities of the device.
CM_CMYK_COLORDevice can accept CMYK color space ICC color profile.
CM_DEVICE_ICMDevice can perform ICM on either the device driver or the device itself.
CM_GAMMA_RAMPDevice supports GetDeviceGammaRamp and SetDeviceGammaRamp
CM_NONEDevice does not support ICM.


Return Value
The return value specifies the value of the desired item.
When nIndex is BITSPIXEL and the device has 15bpp or 16bpp, the return value is 16.
Remarks
When nIndex is SHADEBLENDCAPS:
For a printer, GetDeviceCaps returns whatever the printer reports.
For a display device, all blending operations are available; besides SB_NONE, the only return values are SB_CONST_ALPHA and SB_PIXEL_ALPHA, which indicate whether these operations are accelerated.
On a multiple monitor system, if hdc is the desktop, then GetDeviceCaps returns the capabilities of the primary monitor.
GetDeviceCaps provides the following six indexes in place of printer escapes.
IndexPrinter escape replaced
PHYSICALWIDTHGETPHYSPAGESIZE
PHYSICALHEIGHTGETPHYSPAGESIZE
PHYSICALOFFSETXGETPRINTINGOFFSET
PHYSICALOFFSETYGETPHYSICALOFFSET
SCALINGFACTORXGETSCALINGFACTOR
SCALINGFACTORYGETSCALINGFACTOR

Examples
For an example, see Preparing to Print .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Device Contexts Overview
Device Context Functions
CreateEnhMetaFile
CreateIC
DeviceCapabilities
GetDIBits
GetObjectType
SetDIBits
SetDIBitsToDevice
StretchBlt
StretchDIBits
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144877(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:31:58