SelectClipPath function (wingdi.h)

The SelectClipPath function selects the current path as a clipping region for a device context, combining the new region with any existing clipping region using the specified mode.

Syntax

BOOL SelectClipPath(
  [in] HDC hdc,
  [in] int mode
);

Parameters

[in] hdc

A handle to the device context of the path.

[in] mode

The way to use the path. This parameter can be one of the following values.

Value Meaning
RGN_AND
The new clipping region includes the intersection (overlapping areas) of the current clipping region and the current path.
RGN_COPY
The new clipping region is the current path.
RGN_DIFF
The new clipping region includes the areas of the current clipping region with those of the current path excluded.
RGN_OR
The new clipping region includes the union (combined areas) of the current clipping region and the current path.
RGN_XOR
The new clipping region includes the union of the current clipping region and the current path but without the overlapping areas.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

The device context identified by the hdc parameter must contain a closed path.

Examples

For an example, see Using Clipping.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

BeginPath

Clipping Functions

Clipping Overview

EndPath