IntersectClipRect function

The IntersectClipRect function creates a new clipping region from the intersection of the current clipping region and the specified rectangle.

Syntax


int IntersectClipRect(
  _In_ HDC hdc,
  _In_ int nLeftRect,
  _In_ int nTopRect,
  _In_ int nRightRect,
  _In_ int nBottomRect
);

Parameters

hdc [in]

A handle to the device context.

nLeftRect [in]

The x-coordinate, in logical units, of the upper-left corner of the rectangle.

nTopRect [in]

The y-coordinate, in logical units, of the upper-left corner of the rectangle.

nRightRect [in]

The x-coordinate, in logical units, of the lower-right corner of the rectangle.

nBottomRect [in]

The y-coordinate, in logical units, of the lower-right corner of the rectangle.

Return value

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

Return codeDescription
NULLREGION

Region is empty.

SIMPLEREGION

Region is a single rectangle.

COMPLEXREGION

Region is more than one rectangle.

ERROR

An error occurred. (The current clipping region is unaffected.)

 

Remarks

The lower and right-most edges of the given rectangle are excluded from the clipping region.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

See also

Clipping Overview
Clipping Functions
ExcludeClipRect

 

 

Show: