INFO: Basics of Banding Printing in Windows

This article was previously published under Q75471
This article has been archived. It is offered "as is" and will no longer be updated.
3.00 3.10WINDOWSkbprg
Banding is a technique used to implement the full functionality of theWindows Graphics Device Interface (GDI) in printer drivers that canonly print bitmaps for graphics. An application that is aware of thebanding process can enhance its printing performance.
Most dot-matrix printers and many laser printers cannot print graphicssuch as polygons and lines. They can print only bitmaps and text.These printers require special support in GDI to implement the fullrange of GDI functionality.

When an application prints to such a device, the printer driver doesnot send output directly to the printer. Rather, the printer drivergenerates a bitmap in memory. When all graphics have been renderedinto the bitmap, the bitmap itself is printed.

For most printers, the bitmap can be very large. For example, a 300dots-per-inch (dpi) laser printer requires nearly a megabyte to rendera single letter-size page. To reduce memory requirements, the image isbroken into a sequence of smaller rectangles, called bands, whichcover the page. Each of these individual rectangles is rendered anddownloaded to the printer separately.

There are two ways that the graphics calls can be duplicated on eachband. If the application is unaware of the banding process, GDI willcapture all graphics calls for a page into a metafile. When theapplication calls the NEWFRAME (next page) escape, GDI plays theentire metafile into each band. Alternatively, the application mayrequest 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, theprocess is very similar. Banding printer drivers implement an escapecalled NEXTBAND. The escape causes the printer driver to download theprevious band to the printer (if any) and to initialize itself torender the new band. It also returns a rectangle defining the boundsof the band bitmap relative to the whole page. Output calls made tothe driver's Device Context (DC) after NEXTBAND go directly to theprinter driver.

GDI, or the banding application, calls NEXTBAND after each band isrendered to download the band and also to retrieve the next band fromthe driver. When all bands have been printed, NEXTBAND causes theprinter driver to eject the page and return an empty rectangle toindicate the end of a page.

For more information on how to implement banding, query on thefollowing words:
prod(winsdk) and banding
3.00 3.10

Article ID: 75471 - Last Review: 10/07/2013 00:47:33 - Revision: 1.1

Microsoft Windows Software Development Kit 3.1

  • kbnosurvey kbarchive kb16bitonly kbinfo KB75471