Previous Next

Customized Halftoning

Unidrv allows halftoning operations to be performed by GDI, by the printer device, or by customized driver code. This section explains how to perform halftoning operations in customized driver code.

Two types of customization are available:

Customized Halftone Patterns

Halftone patterns can be specified in a resource DLL, or they can be generated by a rendering plug-in that implements the IPrintOemUni::HalftonePattern method. IPrintOemUni::HalftonePattern should be implemented if either of the following is true:

The IPrintOemUni::HalftonePattern method's purpose is to return a usable halftone pattern to Unidrv, which in turn passes it to GDI. The method can either decode a pattern that is stored in a resource DLL in an encrypted form, or it can generate a pattern during execution.

If you implement the IPrintOemUni::HalftonePattern method, your generic printer description (GPD) file must include an *HTCallbackID attribute in each halftoning *Option entry that specifies a halftoning method for which a customized pattern is used. For more information about this attribute, see Option Attributes for the Halftone Feature.

Customized Halftoning Methods

For a printer that uses Unidrv, providing code that implements customized halftoning methods requires the following steps:

  1. Provide a rendering plug-in that implements the IPrintOemUni::ImageProcessing method.
  2. Include a Halftone *Feature entry in the printer's GPD file, with each contained *Option entry representing a halftoning method. (Standard and customized halftoning methods can both be included.)

The IPrintOemUni::ImageProcessing method receives GDI bitmaps as input. The method must perform halftoning operations, based on the currently selected halftoning method, and return the resulting bitmap to Unidrv.

If a rendering plug-in implements IPrintOemUni::ImageProcessing, it can also implement the IPrintOemUni::MemoryUsage.

For more information about halftoning, see Halftoning with Unidrv.