InvertRect

2.x

  void InvertRect(hdc, lprc)    
  HDC hdc; /* handle of device context */
  const RECT FAR* lprc; /* address of structure with rectangle */

The InvertRect function inverts a rectangular area. Inversion is a logical NOT operation and flips the bits of each pixel.

Parameters

hdc

Identifies the device context.

lprc

Points to a RECT structure that contains the logical coordinates of the rectangle to be inverted. The RECT structure has the following form:

typedef struct tagRECT {    /* rc */
   int left;
   int top;
   int right;
   int bottom;
} RECT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

This function does not return a value.

Comments

On monochrome screens, the InvertRect function 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, specifying the same rectangle, restores the display to its previous colors.

The InvertRect function compares the values of the top, bottom, left, and right members of the specified rectangle. If bottom is less than or equal to top, or if right is less than or equal to left, the function does not draw the rectangle.

See Also

FillRect