DrvDitherColor

ULONG DrvDitherColor(

    IN DHPDEV  dhpdev,
   IN ULONG  iMode,
   IN ULONG  rgb,
   OUT ULONG  *pul
  );

DrvDitherColor requests the device to create a brush dithered against a device palette.

Parameters

dhpdev

Pointer to the PDEV that describes the physical device against whose palettes the specified color should be dithered.

iMode

Determines the palette to dither against. The currently defined values are DM_DEFAULT and DM_MONOCHROME.

rgb

Specifies the RGB color that is to be dithered.

pul

Points to the memory location in which the dithering information is to be recorded. Memory must have been allocated for a standard-format bitmap with dithered brush dimensions cxDither by cyDither. These dimensions are members of the DEVINFO structure. The bitmap format is determined by the iDitherFormat member of the DEVINFO structure.

Return Value

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.

Comments

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.

See Also

DEVINFO, DrvEnablePDEV