Unidrv allows you to perform halftoning operations using GDI, 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
Customized halftoning methods
You can specify halftone patterns in a resource DLL, or you can generate them by a rendering plug-in that implements the IPrintOemUni::HalftonePattern method. The reference page for this method provides an example of how to generate a halftone pattern.
IPrintOemUni::HalftonePattern should be implemented if either of the following is true:
Customized patterns are provided in a resource DLL, and the patterns are encrypted.
Customized patterns are not provided in a resource DLL. Instead, they are generated by IPrintOemUni::HalftonePattern.
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 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.
For a printer that uses Unidrv, the steps to provide code that implements customized halftoning methods are as follows:
Provide a rendering plug-in that implements the IPrintOemUni::ImageProcessing method.
Include a Halftone *Feature entry in the printer's GPD file, with each contained *Option entry that represents 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.
For more information about halftoning, see Halftoning with Unidrv.