The subtraction is the smallest rectangle that contains all of the points in lpRectScr1 that are not in the intersection of lpRectScr1 and lpRectScr2.
The rectangle specified by lpRectSrc1 will be unchanged if the rectangle specified by lpRectSrc2 doesn't completely overlap the rectangle specified by lpRectSrc1 in at least one of the x- or y-directions.
For example, if lpRectSrc1 were (10,10, 100,100) and lpRectSrc2 were (50,50, 150,150), the rectangle pointed to by lpRectSrc1 would be unchanged when the function returned. If lpRectSrc1 were (10,10, 100,100) and lpRectSrc2 were (50,10, 150,150), however, the rectangle pointed to by lpRectSrc1 would contain the coordinates (10,10, 50,100) when the function returned.
SubtractRect is not the same as operator - nor operator -=. Neither of these operators ever calls SubtractRect.
Note: |
|---|
Both of the rectangles must be normalized or this function may fail. You can call
NormalizeRect to normalize the rectangles before calling this function.
|