INF: Basics of Banding Printing in Windows

ID Number: Q75471

3.00 3.10

WINDOWS

Summary:

Banding is a technique used to implement the full functionality of the

Windows graphics device interface (GDI) in printer drivers that can

only print bitmaps for graphics. An application that is aware of the

banding process can enhance its printing performance.

More Information:

Most dot-matrix printers and many laser printers cannot print graphics

such as polygons and lines. They can print only bitmaps and text.

These printers require special support in GDI to implement the full

range of GDI functionality.

When an application prints to such a device, the printer driver does

not send output directly to the printer. Rather, the printer driver

generates a bitmap in memory. When all graphics have been rendered

into the bitmap, the bitmap itself is printed.

For most printers, the bitmap can be very large. For example, a 300

dots-per-inch (dpi) laser printer requires nearly a megabyte to render

a single letter-size page. To reduce memory requirements, the image is

broken into a sequence of smaller rectangles, called bands, which

cover the page. Each of these individual rectangles is rendered and

downloaded to the printer separately.

There are two ways that the graphics calls can be duplicated on each

band. If the application is unaware of the banding process, GDI will

capture all graphics calls for a page into a metafile. When the

application calls the NEWFRAME (next page) escape, GDI plays the

entire metafile into each band. Alternatively, the application may

request a band from the printer driver and produce the output itself.

A significant optimization results since GDI will not need to create,

write, and reread a disk-based metafile.

Whether GDI or the application requests the band from the driver, the

process is very similar. Banding printer drivers implement an escape

called NEXTBAND. The escape causes the printer driver to download the

previous band to the printer (if any) and to initialize itself to

render the new band. It also returns a rectangle defining the bounds

of the band bitmap relative to the whole page. Output calls made to

the driver's device context (DC) after NEXTBAND go directly to the

printer driver.

GDI, or the banding application, calls NEXTBAND after each band is

rendered to download the band and also to retrieve the next band from

the driver. When all bands have been printed, NEXTBAND causes the

printer driver to eject the page and return an empty rectangle to

indicate the end of a page.

For more information on how to implement banding, query on the

following words:

prod(winsdk) and banding

Additional reference words: 3.00 3.10 3.x