ExtSelectClipRgn

  int ExtSelectClipRgn(hdc, hrgn, iMode)    
  HDC hdc; /* handle of device context */
  HRGN hrgn; /* handle of region */
  int iMode; /* region-selection mode */

The ExtSelectClipRgn function combines the given region with the current clip region using the specified mode.

Parameters

hdc

Identifies the device context.

hrgn

Identifies the region to be selected. This handle can only be NULL when the RGN_COPY mode is specified.

iMode

Specifies the operation to be performed. It must be one of the following values:

Type Meaning

RGN_AND The new clip-region combines the overlapping areas of the current clip region and the region identified by hrgn.
RGN_COPY The new clip-region is a copy of the region identified by hrgn. This is identical to SelectClipRgn. If the region identified by hrgn is NULL, the new clip region is the default clip region (the default clip region is a null or empty region).
RGN_DIFF The new clip region combines the areas of the current clip region with those areas excluded from the region identified by hrgn.
RGN_OR The new clip region combines the current clip region and the region identified by hrgn.
RGN_XOR The new clip region combines the current clip region and the region identified by hrgn but excludes any overlapping areas.

Return Value

The return value specifies the new clip region's complexity if the function is successful. It can be any one of the following values:

Value Meaning

NULLREGION Region is empty.
SIMPLEREGION Region is a single rectangle.
COMPLEXREGION Region is more than a single rectangle.
ERROR Error occurred.

Comments

If an error occurs when this function is called, the previous clip region for the given device context is not affected.

The ExtSelectClipRgn function assumes that the coordinates for the given region are specified in device units.

Only a copy of the given region identified by hrgn is used. The region itself can be reused after this call, or it can be deleted.

See Also

SelectClipRgn