The area covered by the rectangle starts in (Left,Bottom) pixel and spans (Width,Height) pixels. This means that the right-top pixel covered by the rectangle is (Left + Width - 1,Bottom + Height - 1). The rectangle is empty (Contains will always answer False
) when either Width or Height are zero. Neither Width nor Height can ever be negative.