SET_CLIP_BOX

short Escape(hdc, SET_CLIP_BOX, sizeof(RECT),lpClipBox, (LPSTR) NULL)

The SET_CLIP_BOX printer escape sets the clipping rectangle or restores the previous clipping rectangle. This escape is implemented by printer drivers that use the coordinate-transformation escapes TRANSFORM_CTM, SAVE_CTM, and RESTORE_CTM.

When an application calls a graphics device interface (GDI) output function, GDI calculates a clipping rectangle bounding the primitive and passes both the primitive and the clipping rectangle to the printer driver. The printer driver is expected to clip the primitive to the specified bounding rectangle. However, when an application uses the coordinate-transformation escapes, the clipping rectangle calculated by GDI is usually invalid. An application can use the SET_CLIP_BOX escape to specify the correct clipping rectangle when coordinate transformations are used.

Parameters

hdc

HDC Identifies the device context.

lpClipBox

LPRECT Points to a RECT structure containing the bounding rectangle of the clipping region. If lpClipBox is not NULL, the previous clipping rectangle is saved and the current clipping rectangle is set to the specified bounds. If lpClipBox is NULL, the previous clipping rectangle is restored.

Return Value

The return value is nonzero if the clipping rectangle was properly set. Otherwise, it is zero.

Comments

This escape is used only by PostScript printer drivers.