Windows Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

InvertRect function

The InvertRect function inverts a rectangle in a window by performing a logical NOT operation on the color values for each pixel in the rectangle's interior.

Syntax


BOOL InvertRect(
  _In_       HDC  hDC,
  _In_ const RECT *lprc
);

Parameters

hDC [in]

A handle to the device context.

lprc [in]

A pointer to a RECT structure that contains the logical coordinates of the rectangle to be inverted.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

On monochrome screens, InvertRect makes white pixels black and black pixels white. On color screens, the inversion depends on how colors are generated for the screen. Calling InvertRect twice for the same rectangle restores the display to its previous colors.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Filled Shapes Overview
Filled Shape Functions
FillRect
RECT

 

 

Community Additions

Show:
© 2015 Microsoft