Inversion is a logical NOT operation and flips the bits of each pixel. On monochrome displays, the function makes white pixels black and black pixels white. On color displays, the inversion depends on how colors are generated for the display. Calling InvertRect twice with the same rectangle restores the display to its previous colors.
void CDCView::DoInvertRect(CDC* pDC)
// invert rect from 20,20 to 50,50
CRect rect(20, 20, 50, 50);
// inverting again restores to normal