Declare Function InvertRect Lib "user32.dll" (ByVal hdc As Long, ByVal lpRect As RECT) As Long
Platforms: Win 32s, Win 95/98, Win NT
InvertRect inverts the image inside a rectangular area on a device. The inverted colors are calculated by taking the binary NOT of each pixel's RGB color value inside the rectangle. The function returns a non-zero value if successful, or 0 if an error occured.
Example:
' Invert the colors in the rectangle (20,30)-(150,100) on window Form1.
Dim r As RECT ' rectangle to invert
Dim retval As Long ' return value
retval = SetRect(r, 20, 30, 150, 100) ' set r to be (20,30)-(150,100)
retval = InvertRect(Form1.hDC, r) ' invert the pixels within the rectangle
Related Call: InvertRgn
Category: Filled Shapes
Back to the index.