short Escape(hDC, SET_CLIP_BOX, sizeof(RECT),lpInData, (LPSTR)NULL)
This escape sets the clipping rectangle or restores the previous clipping rectangle. This escape is implemented by printer drivers that implement the coordinate-transformation escapes TRANSFORM_CTM, SAVE_CTM, and RESTORE_CTM.
When an application calls a 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.
Parameter | Type/Description |
hDC | HDC Identifies the device context. | |
lpClipBox | LPRECT Points to a RECT data structure containing the bounding rectangle of the clipping area. 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. |
The return value is TRUE if the clipping rectangle was properly set. Otherwise, it is FALSE.