Getdevicecaps (HDC, bitspixel)

Source: Internet
Author: User
Obtain the number of digits of the system color.
Getdevicecaps (HDC, bitspixel) References
Getdevicecaps function: This function retrieves the specified information of a specified device.
Function prototype: int getdevicecaps (HDC, int nlndex );
Parameters:
1. HDC: handle of the device context.
2. nindex: Specifies the return item. This parameter takes the following values. (C ++)
Driverversion: The driver version of the device.
Technology: device technology, which can be one of the following values:
Dt_plotter: vector plotter; dt_rasdisplay: grating display;
Dt_rasprinter: grating printer; dt_rascamera: grating camera;
Dt_charstream: Metadata stream; dt_metafile: metadata file;
Dt_dispfile: display file.
If the HDC parameter specifies the device context environment of the Metafile, the device technology is to reference the device of the createenhmetafile function. You can use the getobjecttype function to determine whether the device context environment of the Metafile is enhanced.
Horzsize: width of the physical screen (in millimeters); vertsize: height of the physical screen (in millimeters); horzres: width of the screen (in pixels );
Vertres: screen height (grating line );
Logpixelsx: number of records per logical inch along the screen width. In Multiple display systems, this value is the same for the display;
Logpixelsy: number of records per logical inch along the screen height. In Multiple display systems, this value is the same for all displays;
Bitspixel: number of pixels connected to the color; planes: Number of color bit sides; numbrushes: number of devices that specify the number of pictures in the same painting;
Numpens: the number of PEN specified by the device; numfonts: the number of fonts specified by the device;
Numcolors: number of entries in the device color table. If the color depth of the device is no more than 8 pixels. -1 is returned for devices that exceed the color depth;
Aspectx: The relative width of the pixel used to draw the line; aspecty: The relative height of the pixel used to draw the line;
Aspectxy: the diagonal width of the pixel used to draw a line; pdevlcesize: reserved;
Clidcaps: displays the signs that the device supports shear performance. If the device can be cut into a rectangle, it is 1; otherwise, it is 0;
Sizepalette: number of entries in the system palette. RC is only set on the device drive in the rastercaps index.
This index value is valid when the paletfe bit is used. The index value can only be used on a 16-bit Windows Drive;
Numreserved: number of entries retained in the system palette. RC is set only on the device drive in the rasterlap index.
Paletfe bit, the index value is valid and the index value can only be 16 bits on a Windows drive;
Colorres: the actual device color of the actual bit image. The index value is valid only when the device drive sets the rcpaletfe bit in the rasterlap index. The index value can only be used for a 16-bit Windows Drive;
Physicalwidth: the width of the physical page in the unit of the device for printing devices. For example, the physical unit width of a printer set to 600dpi on 8.5*11 is 5100. Note that the physical page is always larger than the printable page area and never smaller;
Phpsicalheight: The physical page width in the unit of devices. For example, the physical unit height of a printer set to 600dpi on 8.5*11 is 6600;
Physicaloffsetx: the distance from the left side of the physical page to the right side of the print page. For example, a printer set to 600dpi on 8.5*11 paper cannot print more than 0.25 on the left, there is a horizontal physical displacement of 150 slave units;
Physicaloffsety; for printing devices. The distance from the physical page to the top of the printed page. For example, a printer on the 8.5*11 printing paper cannot be placed in a place beyond the top, and there is a physical shift of the device unit;
Vrefresh: Windows
NT: For display devices. The current vertical refresh rate of the device is measured in cycles per second (unit: 0 or 1). The default refresh rate of the hardware is displayed. The default refresh rate is usually changed by setting the jumper of the video card or motherboard, or use a function that does not use Win32 display, such as changedisplay.
Setting is set by a configuration program;
Export tophorzres: Windows
NT: the width of the visible desktop in pixels. If the device supports a visual desktop or dual display, this value may be greater than vertres;
Scalingfactorx: proportional coefficient of the printer X axis; scalingfactory: proportional coefficient of the printer Y axis.
Bltalignment: in Windows
Horizontal plot adjustment in NT as a pixel multiple. For the best drawing operation, the window plot should be a multiple of the horizontal adjustment to this value. 0 indicates that the device is accelerated and any adjustment is available.
Shadeblendcaps: in Windows 98, Windows NT
In versions 5.0 and later, this value displays the shadow and mixed features of the device.
Sb_const_alpha: process the source in the blendfunction Structure
The constantalpha element is specified by the blendfunction parameter in the alphablend number;
Sb_grad_rect: ability to fill gradientfill rectangles. Sb_grad_tri; ability to fill gradientfill triangles;
Sb_none: The device does not support any of these features. Sb_pixel_alpha: process each pixel alphx in alphablond;
Sb_premult_alpha: premultiplication of alpha in alphablend;
Rastercaps: the grating performance supported by the device. It can be a combination of the following values;
Rc_banding: joint support is required. Rc_bitblt: supports bitmap transfer.
Rc_bitmap64: supports bitmap larger than 64 KB. Rc_di_bitmap: supports setdibits and getdibits functions.
Rc_dibtodev: supports setdibits
Device function; rc_floodfill: supports continuous filling.
Rc_gdi20_output: supports 16-bit windows
2.0 features; rc_palette: Specifies a palette-based device.
Rc_scaling: supports scaling; rc_stretchblt: supports the stretchblt function.
Rc_stretchdib: stretchdibits function.
Curvecaps: displays the curve performance supported by the device. It can be a combination of the following values.
Cc_none: Curve cannot be drawn; cc_chord: string can be drawn; cc_circles: circle can be drawn.
Cc_ellipses: supports drawing an ellipse; cc_interiors: supports internal filling; cc_pie: supports drawing a slice chart.
Cc_roundrect: supports drawing rounded rectangle; cc_styled: supports drawing border with style.
Cc_wide: supports drawing wide boundary; cc_widestyled: supports drawing wide and style boundary.
The linear performance supported by linecaps can be a combination of the following values:
Lc_none: Line Segments cannot be drawn; lc_interiors: internal filling is supported; lc_marker: marking is supported.
Lc_polyline: supports broken lines; lc_polymarker: supports multiple tags; lc_styled: line segments with styles.
Lc_wide: supports wide line drawing; lc_widestyled: supports wide line segments with styles.
Polygonalcaps supports polygon performance. It can be a combination of the following values.
Pc_none: polygon cannot be drawn; pc_interiors: Internal fill supported; pc_polygon: polygon can be drawn in an interval.
Pc_rectangle: supports drawing rectangles; pc_scanline: supports drawing scanning lines; pc_styled: supports drawing border with style.
Pc_wide: supports drawing wide borders; pc_widestyled: supports drawing wide border with style.
Pc_windpolygon: polygon can be drawn in line.
The textcaps device supports a combination of the following values:
Tc_op_character: supports character output precision; tc_op_stroke: supports stroke output precision.
Tc_cp_stroke: supports stroke cutting precision; tc_cr_90: supports 90-degree rotation of characters;
Tc_cr_any: supports character rotation at any angle; tc_sf_x_yindep: supports independent scaling in the X and Y directions.
Tc_sa_double: supports doubling characters; tc_sa_integer: supports integer doubling.
Tc_sa_contin: supports strict scaling by any number of multiples; tc_ea_double: supports increasing characters.
Tc_ia_able: supports oblique fonts; tc_ua_able: supports underlines; tc_so_able: supports strikethrough.
Tc_ra_able: supports grating fonts; tc_va_able: supports Vector Fonts; tc_reserved: reserved, must be zero.
Tc_scrollblt: bit fast transfer is not supported for rolling. Note that this may be counterproductive.
These are some C ++ parameters. The specific values of some parameters in C # are provided below.
All types are declared as Int or int32.
Driverversion = 0
Technology = 2
Horzsize = 4
Vertsize = 6
Horzres = 8
Vertres = 10
Bitspixel = 12
Planes = 14
Numbrushes = 16
Numpens = 18
Nummarkers = 20
Numfonts = 22
Numcolors = 24
Pdevicesize = 26
Curvecaps = 28
Linecaps = 30
Polygonalcaps = 32
Textcaps = 34
Clipcaps = 36
Rastercaps = 38
Aspectx = 40
Aspecty = 42
Aspectxy = 44
Shadeblendcaps = 45
Logpixelsx = 88
Logpixelsy = 90
Sizepalette = 104
Numreserved= 106
Colorres = 108.
Physicalwidth = 110
Physicalheight = 111
Physicaloffsetx = 112
Physicaloffsety = 113
Scalingfactorx= 114
Scalingfactory = 115
Vrefreesh = 116
Optional topvertres = 117
Required tophorzres = 118
Bltalignment = 119
Return Value: the return value specifies the value of the required project.
Note: getdevicecaps provides the following six indexes to replace the printer.
Physicalwidth getphyspagesize; physicalheight
Getphyspagesize
Physicaloffsetx getprintingoffset;
Physicaloffsety getphysicaloffset;
Scalingfactorx getscalingfactor;
Scalingfactory getscalingfactor;
Windows CE: Windows CE does not support the following nindex values:
Vrefresh; optional tophorzres;
Optional topvertres; bltalignment
Windows CE 1.0 does not support the following nindex values:
Physicalwidth; physicalheight; physicaloffsetx;
Physicaloffsety
Quick query: Windows NT: 3.1 and later; windows: 95 and later; windows
CE: 1.0 or later; header file: wingdi. h; library file: gdi32.lib.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.