typedef struct tagGDIINFO { short int dpVersion; short int dpTechnology; short int dpHorzSize; short int dpVertSize; short int dpHorzRes; short int dpVertRes; short int dpBitsPixel; short int dpPlanes; short int dpNumBrushes; short int dpNumPens; short int dpCapsFE; short int dpNumFonts; short int dpNumColors; short int dpDEVICEsize; unsigned short int dpCurves; unsigned short int dpLines; unsigned short int dpPolygonals unsigned short int dpText; unsigned short int dpClip; unsigned short int dpRaster; short int dpAspectX; short int dpAspectY; short int dpAspectXY; short int dpStyleLen; POINT dpMLoWin; POINT dpMLoVpt; POINT dpMHiWin; POINT dpMHiVpt; POINT dpELoWin; POINT dpELoVpt; POINT dpEHiWin; POINT dpEHiVpt; POINT dpTwpWin; POINT dpTwpVpt; short int dpLogPixelsX; short int dpLogPixelsY; short int dpDCManage; unsigned short int dpCaps1; long dpSpotSizeX; long dpSpotSizeY; short int dpNumPalReg; short int dpPalReserved; short int dpColorRes; } GDIINFO;
Contains information about the graphics device supported by a device driver. GDI retrieves this structure when it loads the driver and uses the information in the structure to initialize the driver.
dpVersion
Version number. The high-order byte specifies the major version, the low-order byte the minor version. For example, in a device driver developed for Windows 3.1, this member should contain 0x030A.
dpTechnology
Device technology. Can be one of these values:
DT_PLOTTER (0) | Vector plotter |
DT_RASDISPLAY (1) | Raster display |
DT_RASPRINTER (2) | Raster printer |
All other values are reserved.
dpHorzSize
Width, in millimeters, of the physical display surface.
dpVertSize
Height, in millimeters, of the physical display surface.
dpHorzRes
Width, in pixels, of the display surface. For nonraster devices, this width is equivalent to the number of vertical grid lines used by the device to plot points on the display surface. In such cases, a pixel is defined to be the smallest mark the device can draw.
dpVertRes
Height, in raster lines, of the display. For nonraster devices, this height is equivalent to the number of horizontal grid lines used by the device to plot points on the display surface. In such cases, a raster line is equivalent to a gridline.
dpBitsPixel
Number of adjacent bits on each plane required to define a single pixel.
dpPlanes
Number of planes required to define the pixels. For a typical raster device with red, green, and blue bit planes (such as a 3-plane EGA), this member is 3.
dpNumBrushes
Number of device-specific brushes supported by the device.
dpNumPens
Number of device-specific pens supported by the device.
dpCapsFE
Capability bits for Far East fonts. Can be a combination of these values:
FEC_TT_DBCS (0x0020) | Can output DBCS True Type fonts |
FEC_WIFE_ABLE (0x0080) | Can handle WIFE font as Engine font |
dpNumFonts
Number of device-specific fonts supported by the device.
dpNumColors
Number of entries in the color table for the device or the number of reserved colors for a palette-capable device.
dpDEVICEsize
Size, in bytes, of the PDEVICE structure for this device. It must be at least two bytes.
dpCurves
Curve-drawing capabilities. This member specifies the types of curves a device can draw, whether the interior of those figures that can be handled can be brushed in, and whether the borders of those figures that can be handled can be drawn with wide lines, styled lines, or lines that are both wide and styled. Can be a combination of these values:
CC_NONE (0x0000) | Curves not supported. |
CC_CIRCLES (0x0001) | Draws circles. |
CC_PIE (0x0002) | Draws pie wedges. |
CC_CHORD (0x0004) | Draws chord arcs. |
CC_ELLIPSES (0x0008) | Draws ellipses. |
CC_WIDE (0x0010) | Draws wide lines. |
CC_STYLED (0x0020) | Draws styled lines. |
CC_WIDESTYLED (0x0040) | Draws lines that are wide and styled. |
CC_INTERIORS (0x0080) | Draws interiors. |
CC_ROUNDRECT (0x0100) | Draws round rectangles. |
CC_POLYBEZIER (0x0200) | Draws poly Bezier splines. |
All other values are reserved.
dpLines
Polyline and line-drawing capabilities. This member also specifies the types of lines a device can draw, whether the interior of figures can be brushed in, and whether the borders of figures can be drawn with wide lines, styled lines, or lines that are both wide and styled. Can be a combination of these values:
LC_NONE (0x0000) | Lines not supported. |
LC_POLYSCANLINE (0x0001) | Draws a group of scanlines. |
LC_POLYLINE (0x0002) | Draws polylines. |
LC_WIDE (0x0010) | Draws wide lines. |
LC_STYLED (0x0020) | Draws styled lines. |
LC_WIDESTYLED (0x0040) | Draws wide styled lines. |
LC_INTERIORS (0x0080) | Draws interiors. |
All other values are reserved. The high-order byte must be zero.
dpPolygonals
Polygon-, rectangle-, and scan-line drawing capabilities. This member also specifies whether the interior of those figures that can be handled can be brushed in, and whether the borders of those figures that can be handled can be drawn with wide lines, styled lines, or lines that are both wide and styled. Can be a combination of these values:
PC_NONE (0x0000) | Polygons not supported. |
PC_ALTPOLYGON (0x0001) | Draws alternate-fill polygons. |
PC_RECTANGLE (0x0002) | Draws rectangles. |
PC_WINDPOLYGON (0x0004) | Draws winding-number-fill polygons. |
PC_SCANLINE (0x0008) | Draws scan lines. |
PC_WIDE (0x0010) | Draws wide borders. |
PC_STYLED (0x0020) | Draws styled borders. |
PC_WIDESTYLED (0x0040) | Draws borders that are wide and styled. |
PC_INTERIORS (0x0080) | Draws interiors. |
PC_POLYPOLYGON (0x0100) | Draws multiple polygons. |
PC_PATHS (0x0200) | Draws paths. |
All other values are reserved. The high byte must be zero.
dpText
Level of text support the device driver provides. Can be a combination of these values:
TC_OP_CHARACTER (0x0001) | Generates character-precision text. If this value is not given (or implied by the TC_OP_STROKE value), the driver can generate string-precision text only. |
TC_OP_STROKE (0x0002) | Generates stroke-precision text. This value implies the TC_OP_CHARACTER value. |
TC_CP_STROKE (0x0004) | Draws partially clipped characters. If this value is not given, the character must be entirely within the clipping region to be drawn. |
TC_CR_90 (0x0008) | Rotates characters in 90-degree increments. If this value is not given (or implied by the TC_CR_ANY value), the driver cannot rotate text. |
TC_CR_ANY (0x0010) | Rotates characters to any angle. This value implies the TC_CR_90 value. |
TC_SF_X_YINDEP (0x0020) | Scales characters independently along the x- and y-axes. If this value is not given, the driver may be able to scale characters but not independently along the axes. |
TC_SA_DOUBLE (0x0040) | Scales characters by doubling. If this value is not given (or implied by the TC_SA_INTEGER or TC_SA_CONTIN values), the driver cannot scale text. |
TC_SA_INTEGER (0x0080) | Scales characters by integral multiples. This value implies the TC_SA_DOUBLE value. |
TC_SA_CONTIN (0x0100) | Scales characters by any multiple. This value implies the TC_SA_DOUBLE and TC_SA_INTEGER values. |
TC_EA_DOUBLE (0x0200) | Generates bold characters by doubling the weight. If this value is not given, the driver cannot modify character weights. |
TC_IA_ABLE (0x0400) | Generates italic characters by skewing. |
TC_UA_ABLE (0x0800) | Generates underlined characters. |
TC_SO_ABLE (0x1000) | Generates struck-out characters. |
TC_RA_ABLE (0x2000) | Can use raster fonts to generate text. |
TC_VA_ABLE (0x4000) | Can use vector fonts to generate text. |
TC_RESERVED (0x8000) | Reserved; must be zero. |
If one of these values is specified, the device must support that capability for all fonts, whether realized by the device or provided by GDI.
dpClip
Clipping capabilities. Can be one of these values:
CP_NONE (0) | Cannot clip. |
CP_RECTANGLE (1) | Can clip using a single rectangle. |
CP_REGION (2) | Not supported. |
CP_REGION32 (4) | The driver will receive one of three values for lpClipRect: NULL (meaning cannot clip), or a far pointer to either a REGION or a RECT structure. (If rgn_id is 0x8000 it is a REGION structure; otherwise, it is a RECT structure.) |
dpRaster
Raster capabilities. Can be a combination of these values:
RC_NONE (0x0000) | No raster capabilities. |
RC_BITBLT (0x0001) | Can transfer bitmaps. The driver exports the BitBlt function. |
RC_BANDING (0x0002) | Requires banding support. |
RC_SCALING (0x0004) | Requires scaling support. |
RC_SAVEBITMAP (0x0040) | Saves bitmaps locally in shadow memory. The driver exports the SaveScreenBitmap function. |
RC_PALETTE (0x0100) | Does color-palette management. |
RC_DIBTODEV (0x0200) | Transfers DIBs directly to device. The driver exports the SetDIBitsToDevice function. |
RC_BIGFONT (0x0400) | Supports Windows 3.x fonts. If this value is not given, GDI ensures that the driver receives Windows 2.x fonts only. |
RC_STRETCHBLT (0x0800) | Stretches and compresses bitmaps while transferring the bitmap. The driver exports the StretchBlt function. |
RC_FLOODFILL (0x1000) | Perform flood filling. The driver exports the FloodFill function. |
RC_STRETCHDIB (0x2000) | Stretches and compresses device-independent bitmaps while transferring the bitmap. The driver exports the StretchDIBits function. |
RC_DEVBITS (0x8000) | Supports device bitmaps. Driver exports the BitmapBits and SelectBitmap function. |
dpAspectX
Relative width of a device pixel. This value, in the range 1 through 1000, helps specify the device's aspect ratio.
dpAspectY
Relative height of a device pixel. This value, in the range 1 through 1000, helps specify the device's aspect ratio.
dpAspectXY
Relative diagonal width of a device pixel. This value, in the range 1 through 1000, helps specify the device's aspect ratio. It must be equal to the square root of the sum of the squares of dpAspectX and dpAspectY.
dpStyleLen
Minimum length of a dot generated by a styled pen. The length is relative to the width of a device pixel and should be given in the same units as dpAspectX. For example, if dpAspectX is 5 and the minimum length required is 3 pixels, dpStyleLen should be 15.
dpMLoWin
Width and height of the metric (low resolution) window. The width is dpHorzSize*10; the height is dpVertSize*10.
dpMLoVpt
Horizontal and vertical resolutions of the metric (low resolution) viewport. The horizontal resolution is dpHorzRes; the vertical resolution is –dpVertRes.
dpMHiWin
Width and height of the metric (high resolution) window. The width is dpHorzSize*100; the height is dpVertSize*100.
dpMHiVpt
Horizontal and vertical resolutions of the metric (high resolution) viewport. The horizontal resolution is dpHorzRes; the vertical resolution is –dpVertRes.
dpELoWin
Width and height of the English (low resolution) window. The width is dpHorzSize*1000; the height is dpVertSize*1000.
dpELoVpt
Horizontal and vertical resolutions of the English (low resolution) viewport. The horizontal resolution is dpHorzRes*254; the vertical resolution is –dpVertRes*254.
dpEHiWin
Width and height of the English (high resolution) window. The width is dpHorzSize*10,000; the height is dpVertSize*10,000.
dpEHiVpt
Horizontal and vertical resolutions of the English (high resolution) viewport. The horizontal resolution is dpHorzRes*254; the vertical resolution is –dpVertRes*254.
dpTwpWin
Width and height of the twip window. There are 20 twips per 1 printer's point and 72 printer's points per inch. The width is dpHorzSize*14400; the height is dpVertSize*14400.
dpTwpVpt
Horizontal and vertical resolutions of the twip viewport. The horizontal resolution is dpHorzRes*254; the vertical resolution is –dpVertRes*254.
dpLogPixelsX
Number of pixels per logical inch along a horizontal line on the display surface. This value is used to match fonts.
dpLogPixelsY
Number of pixels per logical inch along a vertical line on the display surface. This value is used to match fonts.
dpDCManage
Device-context management capabilities. Can be one of these values:
0x0000 | Driver allows multiple DCs. It creates a new PDEVICE structure for each DC that specifies a new device and filename pair, but uses the same PDEVICE structure for any subsequent DCs that specify the same device and filename pair. |
DC_SPDEVICE (0x0001) | Driver allows multiple DCs but it creates a new PDEVICE structure for each DC regardless of whether the device and filename pairs are the same. |
DC_1PDEVICE (0x0002) | Driver allows multiple DCs but only if all DCs have unique device and filename pairs. The driver creates a PDEVICE structure for each DC. The driver returns an error on any attempt to create a second DC with an existing device and filename pair. |
DC_IGNOREDFNP (0x0004) | Driver allows multiple DCs but only creates one PDEVICE structure . All DCs share the same PDEVICE structure regardless of the device and filename pairs. |
0x0006 | Driver allows only one DC. The driver returns an error on any attempt to create a second DC. |
The values 0x0003, 0x0005, and 0x0007 are not valid and must not be used.
dpCaps1
Additional raster abilities. Can be one of these values:
C1_TRANSPARENT (0x0001) | Driver supports transparent BitBlts. |
TC_TT_ABLE (0x0002) | Informs GDI that the driver is capable of producing TrueType as raster fonts. The driver must call the dmExtTextOut function to draw the raster font into the bitmap. The value is similar to TC_RA_ABLE. |
C1_TT_CR_ANY (0x0004) | Driver can rotate TrueType fonts. |
C1_EMF_COMPLIANT (0x0008) | Driver supports metafile spooling. |
C1_DIBENGINE (0x0010) | Driver is DIB engine compliant. |
C1_GAMMA_RAMP (0x0020) | Driver supports gamma ramp setting. |
C1_ICM (0x0040) | Driver does some form of ICM support. |
C1_REINIT_ABLE (0x0080) | Driver supports ReEnable call. |
C1_GLYPH_INDEX (0x0100) | Driver supports glyph index fonts. |
C1_BIT_PACKED (0x0200) | Driver supports bit-packed glyphs. |
C1_BYTE_PACKED (0x0400) | Driver supports byte-packed glyphs. |
C1_COLORCURSOR (0x0800) | Driver supports color-cursors and async SetCursors. |
C1_CMYK_ABLE (0x1000) | Driver supports CMYK COLOREF structures. |
C1_SLOW_CARD (0x2000) | Driver has little or no acceleration (for example, VGA). |
All other values are reserved.
dpSpotSizeX
Horizontal spot size for TrueType fonts on this device.
dpSpotSizeY
Vertical spot size for TrueType fonts on this device.
dpNumPalReg
Number of entries in the device's palette. This is the total number of simultaneous colors available for palette-capable devices. Nonpalette-capable devices ignore this value.
dpPalReserved
Even number of reserved system colors available for palette-capable devices. Nonpalette-capable devices ignore this value.
dpColorRes
Palette resolution, which equals the number of bits going into video DACS. Nonpalette-capable devices ignore this value.
The dpText member requires that for each precision level the precision levels below are also set. For example, the TC_SA_INTEGER value requires that the TC_SA_DOUBLE value be set, and the TC_SA_CONTIN value requires that all three values be set. Because the lowest precision level of each capability be supported, no value is provided in dpText for the lowest level of each capability.
The dpAspectX, dpAspectY, and dpAspectXY members specify the relative width, height, and diagonal width of a device pixel and correspond directly to the device's aspect ratio. For devices whose pixels do not have integral diagonal widths, the member values can be multiplied by a convenient factor to preserve information. For example, pixels on a device with a 1 to 1 aspect ratio have a diagonal width of 1.414. For reasonable results, the aspect members should be set to 100, 100, and 141, respectively. For numerical stability, the member values should be kept under 1000.
The window/viewport pair members are the numerator and denominator of the scale fraction used to correct for the device aspect ratio, and to set to a fixed unit of measurement, either metric or English. These numbers should be integers in the range of -32768 through 32767. When calculating these constants, out-of-range values can be divided by some number to bring them back into range as long as the corresponding window or viewport constant is divided by the same number.
The dpRaster member is also used to specify scaling support. If the RC_SCALING value is set, the device does graphics scaling. Certain devices perform graphics at one resolution and text at another. Some applications require that character cells be an integral number of pixels. If a device reports that its graphics resolution is 75 dpi but its text resolution is 300 dpi, its character cells are not an integral number of pixels (because they are digitized at 300 dpi). To get around this problem, GDI uses scaling devices. The device driver registers itself as a 300 dpi device but all the graphics at 300 dpi are scaled to 75 dpi. Any device that scales must have the RC_SCALING value set. Scaling always reduces the resolution; it never increases it. GDI calls the Control function with GETSCALINGFACTOR escape before output to a device. The scaling factor is a shift count that is a power of two. Therefore, a scaling factor of 2 means "reduce by 4", and a scaling factor of 1 means "reduce by 2". Scaling devices are strongly discouraged because compatible bitmaps to scaling devices cannot image both graphics and text.
The number of reserved colors on the palette is always 20, with 16 corresponding to the VGA colors and 4 special colors. Half of the reserved palette colors are placed at the beginning and half at the end of the palette.
See also Enable, PDEVICE