typedef struct _GDIINFO { ULONG ulVersion; ULONG ulTechnology; ULONG ulHorzSize; ULONG ulVertSize; ULONG ulHorzRes; ULONG ulVertRes; ULONG cBitsPixel; ULONG cPlanes; ULONG ulNumColors; ULONG flRaster; ULONG ulLogPixelsX; ULONG ulLogPixelsY; ULONG flTextCaps; ULONG ulDACRed; ULONG ulDACGreen; ULONG ulDACBlue; ULONG ulAspectX; ULONG ulAspectY; ULONG ulAspectXY; LONG xStyleStep; LONG yStyleStep; LONG denStyleStep; POINTL ptlPhysOffset; SIZEL szlPhysSize; ULONG ulNumPalReg; COLORINFO ciDevice; ULONG ulDevicePelsDPI; ULONG ulPrimaryOrder; ULONG ulHTPatternSize; ULONG ulHTOutputFormat; ULONG flHTFlags; ULONG ulVRefresh; ULONG ulBltAlignment; ULONG ulPanningHorzRes; ULONG ulPanningVertRes; } GDIINFO, *PGDIINFO;
The GDIINFO structure describes the graphic capabilities of a given device. GDI zero-initializes this structure before calling the driver-supplied DrvEnablePDEV function.
The version number contained in ulVersion is displayed in the Driver
Information group of the Display Type dialog box displayed by the Display
applet in Control Panel.
Value |
Meaning |
DT_PLOTTER |
Vector plotter |
DT_RASDISPLAY |
Raster display |
DT_RASPRINTER |
Raster printer |
DT_RASCAMERA |
Raster camera |
DT_CHARSTREAM |
Device fonts only |
Because the physical dot size for most printers is larger than the measured dot size, GDI uses this value to approximate how many physical dots can be placed, based on the cell size (pattern size). A log regression is then performed to determine what is most linear; that is, where the dots should be placed for the best coverage to optimize the overlapped device pixels coverage (dot gain).
For displays, this member should be set to zero.
Bit 2(A) |
Bit 1(B) |
Bit 0(C) | |
RGB Primary Colors |
R |
G |
B |
CMY Primary Colors |
C |
M |
Y |
Plane Numbers |
Plane3 |
Plane2 |
Plane1 |
This member can be one of the following values:
PRIMARY_ORDER_ABC
PRIMARY_ORDER_ACB
PRIMARY_ORDER_BAC
PRIMARY_ORDER_BCA
PRIMARY_ORDER_CBA
PRIMARY_ORDER_CAB
HT_PATSIZE_2x2
HT_PATSIZE_2x2_M
HT_PATSIZE_4x4
HT_PATSIZE_4x4_M
HT_PATSIZE_6x6
HT_PATSIZE_6x6_M
HT_PATSIZE_8x8
HT_PATSIZE_8x8_M
HT_PATSIZE_10x10
HT_PATSIZE_10x10_M
HT_PATSIZE_12x12
HT_PATSIZE_12x12_M
HT_PATSIZE_14x14
HT_PATSIZE_14x14_M
HT_PATSIZE_16x16
HT_PATSIZE_16x16_M
HT_PATSIZE_MAX_INDEX
HT_PATSIZE_DEFAULT
HT_FORMAT_1BPP
HT_FORMAT_4BPP
HT_FORMAT_4BPP_IRGB
HT_FORMAT_8BPP
HT_FORMAT_16BPP
HT_FORMAT_24BPP
HT_FORMAT_32BPP
Flag |
Meaning |
HT_FLAG_SQUARE_DEVICE_PEL |
Device pixel is square rather than round (displays only ¾ printers require rounded pixels). |
HT_FLAG_HAS_BLACK_DYE |
Device has separate black dye. |
HT_FLAG_ADDITIVE_PRIMS |
Device primaries are additive. |
HT_FLAG_OUTPUT_CMY |
Device uses CMY primaries rather than RGB. |
The refresh rate contained in ulVRefresh is displayed in the Driver
Information group of the Display Type dialog box displayed by the Display
applet contained in Control Panel.
This value is used by the system to determine the default alignment for window
positions and is also used to set the initial full-drag default during setup.
A value of zero indicates that full-drag should be on by default; any value
other than zero indicates that full-drag should be off by default.
If a driver does not support seamless multiple displays, ulPanningHorzRes and ulPanningVertRes should be set to the same values as ulHorzRez and ulVertRes.
The xStyleStep, yStyleStep, and denStyleStep members define how a cosmetic line style should advance as it draws each pixel of a cosmetic line. The amount advanced along the style for each pixel is defined as a fraction that depends on whether the line is x-styled or y-styled. If the line is x-styled, the style advances by the fractional amount dx/D for each pixel moved in the x direction. Otherwise the style advances by dy/D for each pixel moved in the y direction.
The dots in the predefined line style PS_DOT are each one unit long. If the driver defines xStyleStep as one and denStyleStep as 5, then a dotted horizontal line consists of 5-pixels-on followed by 5-pixels-off, repeated.
Each of these three numbers must be less than 65536, even though the caps members are LONG values. These style steps are defined by the driver to ensure that the dots and dashes in a line are a pleasing size on the output device. The horizontal and vertical steps can be different to correct for non trivial aspect ratios. For example, on an EGA display, whose pixels are 33 percent higher than they are wide, you can set:
pdevcaps->xStyleStep = 3; // For an EGA pdevcaps->yStyleStep = 4; pdevcaps->denStyleStep = 12;
In this case, horizontal dotted lines are 4-pixels-on, 4-pixels-off, because the style advances by 3/12 or 1/4 for each pixel. Vertical dotted lines are 3-pixels-on/3-pixels-off.
Styled lines look better if both the x and y style steps divide evenly into the style denominator, as they do in the preceding example. This gives dashes and dots that are always the same length.
GDI needs this information so that its bitmap functions can emulate exactly what the device does on its own surface. Applications can access this information to determine exactly which pixels will be turned on for styled lines. Refer also to Styled Cosmetic Lines.
CIECHROMA, COLORINFO, DrvBitBlt, DrvCopyBits, DrvEnablePDEV, DrvTextOut