The following information is provided as is, and the authors take no responsibility for the correctness.
The DRAWPATTERNRECT printer escape creates a white, gray scale, or solid black rectangle by using the pattern and rule capabilities of Page Control Language (PCL) on Hewlett-Packard LaserJet or LaserJet-compatible printers. A gray scale is a gray pattern that contains a specific mixture of black and white pixels.
To perform this operation, call the ExtEscape function with the following parameters.
#define DRAWPATTERNRECT 25 int ExtEscape( (HDC) hdc, // handle to device context DRAWPATTERNRECT, // nEscape parameter of ExtEscape sizeof(DRAWPATRECT), // cbInput parameter of ExtEscape lpszInData, // pointer to mode variable 0, // cbOutput parameter of ExtEscape NULL // lpszOutData parameter of ExtEscape );
Identifies the printer device context.
Specifies the escape function to be performed. Use DRAWPATTERNRECT for this operation.
Specifies the number of bytes of data pointed to by the lpszInData parameter. Set this parameter to sizeof(DRAWPATRECT).
Pointer to a DRAWPATRECT structure that describes the rectangle.
Specifies the number of bytes of data pointed to by the lpszOutData parameter. Set this parameter to zero.
Pointer to a buffer to receive output. Set this parameter to NULL.
If the function succeeds, the return value is 1. Otherwise it is zero.
An application should use the QUERYESCSUPPORT escape to determine whether a device is capable of drawing patterns and rules before using the DRAWPATTERNRECT escape.
Applications that use the DRAWPATTERNRECT escape must observe two limitations. First, rules drawn with DRAWPATTERNRECT are not subject to clipping regions in the device context. Second, applications should not try to erase patterns and rules created with DRAWPATTERNRECT by placing opaque objects over them. If the printer supports white rules, these can be used to erase patterns created by DRAWPATTERNRECT. If the printer does not support white rules, there is no method for erasing these patterns.
If an application cannot use the DRAWPATTERNRECT escape, it should generally use the PatBlt function instead. (If PatBlt is used to print a black rectangle, the application should use the BLACKNESS raster operator.) If the device is a plotter, the application should use the Rectangle function.