Customized Halftoning

Important

We recommend that you use Microsoft's IPP inbox class driver, along with Print Support Apps (PSA), to customize the print experience in Windows 10 and 11 for printer device development.

For more information, see the Print support app design guide.

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

>Customized Halftone Patterns

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.

Customized Halftoning Methods

For a printer that uses Unidrv, the steps to provide code that implements customized halftoning methods are as follows:

  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 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.

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

For more information about halftoning, see Halftoning with Unidrv.