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.
DT_PLOTTER (0) | Vector plotter |
DT_RASDISPLAY (1) | Raster display |
DT_RASPRINTER (2) | Raster printer |
All other values are reserved.
FEC_TT_DBCS (0x0020) | Can output DBCS True Type fonts |
FEC_WIFE_ABLE (0x0080) | Can handle WIFE font as Engine font |
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.
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.
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.
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.
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.) |
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. |
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.
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.
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.
Enable, PDEVICE