Article ID: 75471 - View products that this article applies to.
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.10 WINDOWS kbprg
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.
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
Article ID: 75471 - Last Review: October 7, 2013 - Revision: 1.1
Contact us for more help
Connect with Answer Desk for expert help.