The DrvDitherColor function requests the device to create a brush dithered against a device palette.
ULONG
DrvDitherColor(
IN DHPDEV dhpdev,
IN ULONG iMode,
IN ULONG rgb,
OUT ULONG *pul
);
| Value | Meaning |
|---|---|
| DM_DEFAULT | The driver should create a dither for the native, default color space of the device. For example, if the device is running at 16bpp, the resulting dither should be in a 16bpp format. |
| DM_MONOCHROME | The driver should create the dither for monochrome color space; that is, the dither should be returned as a 1bpp bitmap. |
The return value is DCR_DRIVER if the dither values have been calculated by the driver, DCR_SOLID if the engine should use the best solid color approximation of the color, or DCR_HALFTONE if the engine should create a halftone approximation for the driver.
Declared in winddi.h. Include winddi.h.
The result of the dither is a set of device color indices stored in pul. A brush created using these colors for its pattern should be a good approximation of the given color rgb.
DrvDitherColor is an optional function that is called only if cxDither and cyDither are nonzero. Monochrome device drivers, including most raster printers, should use the iMode parameter to tell GDI how to get good gray-scale patterns.