The following information is provided as is, and the authors take no responsibility for the correctness.

Table of Contents

DRAWPATTERNRECT

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
);

Parameters

hdc

Identifies the printer device context.

nEscape

Specifies the escape function to be performed. Use DRAWPATTERNRECT for this operation.

cbInput

Specifies the number of bytes of data pointed to by the lpszInData parameter. Set this parameter to sizeof(DRAWPATRECT).

lpszInData

Pointer to a DRAWPATRECT structure that describes the rectangle.

cbOutput

Specifies the number of bytes of data pointed to by the lpszOutData parameter. Set this parameter to zero.

lpszOutData

Pointer to a buffer to receive output. Set this parameter to NULL.

Return Values

If the function succeeds, the return value is 1. Otherwise it is zero.

Remarks

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.

Requirements

  • Windows NT/2000/XP/Vista: Included in Windows NT 4.0 and later.
  • Windows 95/98/Me: Included in Windows 95 and later.
  • Header: Declared in Wingdi.h; include Windows.h.

 
winspool/printer_escape_functions/drawpatternrect.txt · Last modified: 2007/11/26 13:38 by christoph
 

All text is available under the terms of the GNU Free Documentation License (see Copyrights for details). Disclaimers

Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki