SelectClipRgn function

The SelectClipRgn function selects a region as the current clipping region for the specified device context.

Syntax

int SelectClipRgn(
  HDC  hdc,
  HRGN hrgn
);

Parameters

hdc

A handle to the device context.

hrgn

A handle to the region to be selected.

Return Value

The return value specifies the region's complexity and can be one of the following values.

Return code Description
NULLREGION
Region is empty.
SIMPLEREGION
Region is a single rectangle.
COMPLEXREGION
Region is more than one rectangle.
ERROR
An error occurred. (The previous clipping region is unaffected.)

Remarks

Only a copy of the selected region is used. The region itself can be selected for any number of other device contexts or it can be deleted.

The SelectClipRgn function assumes that the coordinates for a region are specified in device units.

To remove a device-context's clipping region, specify a NULL region handle.

Examples

For an example, see Clipping Output.

Requirements

   
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

Clipping Functions

Clipping Overview

ExtSelectClipRgn