DRAWPATTERNRECT

Syntax

short Escape(hDC, DRAWPATTERNRECT, sizeof(PRECTSTRUCT),lpInData, NULL)

This escape creates a pattern, gray scale, or solid black rectangle by using the pattern/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.

Parameter Type/Description  

hDC HDC Identifies the device context.  
lpInData PRECT_STRUCT FAR * Points to a PRECT_STRUCT data structure that describes the rectangle. See the following “Comments” section for more information on the PRECT_STRUCT data structure.  

Return Value

The return value specifies the outcome of the escape. It is 1 if the escape is successful. Otherwise, it is zero.

Comments

The lpInData parameter points to a PRECT_STRUCT data structure that defines the rectangle to be created. The PRECT_STRUCT structure has the following format:

typedef struct {

POINT prPosition;

POINT prSize;

WORD prStyle;

WORD prPattern;

} PRECT_STRUCT;

This structure has the following fields:

Field Description  

prPosition Specifies the upper-left corner of the rectangle.  
prSize Specifies the lower-right corner of the rectangle.  
prStyle Specifies the type of pattern. It may be one of the following values:  
  Value Meaning
  0 Black rule
  1 White rule that erases bitmap data previously written to same area; this pattern is available on the HP LaserJet IIP only.
  2 Gray scale
  3 HP-defined
prPattern Specifies the pattern. It is ignored for a black rule. It specifies the percentage of gray for a gray-scale pattern. It represents one of six Hewlett-Packard-defined patterns.  

An application should use the QUERYESCSUPPORT escape to determine whether a device is capable of drawing patterns and rules before using the DRAWPATTERNRECT escape. If an application uses the BANDINFO escape, all patterns and rectangles sent by using DRAWPATTERNRECT should be treated as text and sent on a text band.

Do not try to erase patterns and rules created with the DRAWPATTERNRECT escape by placing opaque objects over them. To erase such patterns and rules, use the function calls provided by GDI.