short Escape(hDC, CLIP_TO_PATH, sizeof(int),lpClipMode, NULL)
This escape defines a clipping area bounded by the currently open path. It enables the application to save and restore the current clipping area and to set up an inclusive or exclusive clipping area bounded by the currently open path. If the path defines an inclusive clipping area, portions of primitives falling outside the interior bounded by the path are clipped. If the path defines an exclusive clipping area, portions of primitives falling inside the interior are clipped.
Parameter | Type/Description |
hDC | HDC Identifies the device context. | ||
lpClipMode | LPINT Points to a short integer specifying the clipping mode. It can be one of the following values: | ||
Value | Meaning | ||
CLIP_SAVE (0) | Saves the current clipping area. | ||
CLIP_RESTORE (1) | Restores the previous clipping area. | ||
CLIP_INCLUSIVE (2) | Sets an inclusive clipping area. | ||
CLIP_EXCLUSIVE (3) | Sets an exclusive clipping area. |
The return value specifies the outcome of the escape. It is nonzero if the escape was successful. Otherwise, it is zero.
To clip a set of primitives against a path, an application should follow these steps:
1.Save the current clipping area using the CLIP_TO_PATH escape.
2.Begin a path using the BEGIN_PATH escape.
3.Draw the primitives bounding the clipping area.
4.Close the path using the END_PATH escape.
5.Set the clipping area using the CLIP_TO_PATH escape.
6.Draw the primitives to be clipped.
7.Restore the original clipping area using the CLIP_TO_PATH escape.