SetBoundsRect function

The SetBoundsRect function controls the accumulation of bounding rectangle information for the specified device context. The system can maintain a bounding rectangle for all drawing operations. An application can examine and set this rectangle. The drawing boundaries are useful for invalidating bitmap caches.

Syntax


UINT SetBoundsRect(
  _In_       HDC  hdc,
  _In_ const RECT *lprcBounds,
  _In_       UINT flags
);

Parameters

hdc [in]

A handle to the device context for which to accumulate bounding rectangles.

lprcBounds [in]

A pointer to a RECT structure used to set the bounding rectangle. Rectangle dimensions are in logical coordinates. This parameter can be NULL.

flags [in]

Specifies how the new rectangle will be combined with the accumulated rectangle. This parameter can be one of more of the following values.

ValueMeaning
DCB_ACCUMULATE

Adds the rectangle specified by the lprcBounds parameter to the bounding rectangle (using a rectangle union operation). Using both DCB_RESET and DCB_ACCUMULATE sets the bounding rectangle to the rectangle specified by the lprcBounds parameter.

DCB_DISABLE

Turns off boundary accumulation.

DCB_ENABLE

Turns on boundary accumulation, which is disabled by default.

DCB_RESET

Clears the bounding rectangle.

 

Return value

If the function succeeds, the return value specifies the previous state of the bounding rectangle. This state can be a combination of the following values.

ValueMeaning
DCB_DISABLEBoundary accumulation is off.
DCB_ENABLEBoundary accumulation is on. DCB_ENABLE and DCB_DISABLE are mutually exclusive.
DCB_RESETBounding rectangle is empty.
DCB_SETBounding rectangle is not empty. DCB_SET and DCB_RESET are mutually exclusive.

 

If the function fails, the return value is zero.

Remarks

The DCB_SET value is a combination of the bit values DCB_ACCUMULATE and DCB_RESET. Applications that check the DCB_RESET bit to determine whether the bounding rectangle is empty must also check the DCB_ACCUMULATE bit. The bounding rectangle is empty only if the DCB_RESET bit is 1 and the DCB_ACCUMULATE bit is 0.

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

Painting and Drawing Overview
Painting and Drawing Functions
GetBoundsRect
RECT

 

 

Show: