Expanded BANDINFO DocumentationLast reviewed: July 22, 1997Article ID: Q33252 |
3.00 3.10
WINDOWS
kbprg
The information in this article applies to:
SUMMARYThe following is an expanded version of the documentation of the BANDINFO escape in earlier manuals. Refer to the index or table of contents section to determine where the BANDINFO information is located in the current versions of the documentation.
short Escape(hDC, BANDINFO, nCount, lpInData, lpOutData) MORE INFORMATION
PurposeProvides better communication between a banding driver and the application.
Parameters
Parameter Definition --------- ---------- hDC A handle to the printer display context nCount Not used and can be set to NULL lpInData A long pointer to a data structure that has the following structure: typedef struct { BOOL GraphicsFlag; BOOL TextFlag; RECT GraphicsRect; } BANDINFOSTRUCT; This data structure provides the primary communication between the driver and the application as to what (graphics and/or text) is actually on the page. The notes below describe its use. lpOutData A long pointer to a data structure having the same items as lpInData, a BANDINFOSTRUCT Return Value
Return Value Result ------------ ------ nResult 1 if the function is successful 0 if the function is not successful or if the escape is not implemented NotesThis escape is only implemented for devices that use banding to output to the printer. The escape is called immediately after the NEXTBAND escape, every time the NEXTBAND escape is called. The BANDINFO data structure is used to communicate between the driver and the application as follows:
Data structure Used as lpInData Used as lpOutData field (application communicates (driver communicates to the driver) back to the application) GraphicsFlag TRUE if there are graphics TRUE if the driver is on the page expecting graphics in this band TextFlag TRUE if there is text on TRUE if the driver is the page expecting text in this band GraphicsRect The bounding rectangle for No valid return data all graphics on the pageThis escape is always executed immediately after a NEXTBAND escape and is in reference to the band the driver returned to that escape. Listed below are examples of how the BANDINFO escape can be used to communicate between driver and application.
Code OutlineThe general outline of a routine using BANDINFO to output a page should be as follows:
do { if (BandingDevice) { NEXTBAND BANDINFO } else { /* It is not a banding device. */ /* Set the band to the entire page. */ BandRect.left = 0; BandRect.top = 0; BandRect.right = dxPrinter; BandRect.bottom = dyPrinter; /* Output everything. */ BandInfoOut.GraphicsFlag = TRUE; BandInfoOut.TextFlag = TRUE; } if (TextFlag) { Do any text. } if (GraphicsFlag) { Do any graphics. } } while (BandingDevice && more bands to do); /* NEWFRAME and NEXTBAND are exclusive; however, at least one must be used. Hence we need to do a NEWFRAME if we are not banding. */ if (!BandingDevice) { /* Put out the page. */ if ((SpoolerError = Escape(hDC, NEWFRAME, 0, 0L, 0L)) <= 0) { Result = ConvertSpoolerError(SpoolerError); Escape(hDC, ABORTDOC, 0, 0L, 0L); goto ErrorExit3; } }For more information on full-page banding for text, query on the following words:
prod(winsdk) and four and banding and nonrasterFor more information on BANDINFO, query on the following words:
NEXTBAND and NEWFRAME and BANDINFO and banding and printing |
Additional reference words: 3.00 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |