PtInRect (C++)
Description
The following code example returns whether a given TPoint belongs to the area of a TRect. This is done with the help of PtInRect function.
Code
#include <System.Types.hpp>
int _tmain(int argc, _TCHAR* argv[]) {
TRect *aRectangle = new TRect(1, 2, 8, 10);
TPoint *aPoint = new TPoint(3,4);
if (PtInRect(*aRectangle, *aPoint))
printf("The point appears to be within the bounds of the TRect.");
else
printf("The point does not belong to the TRect area.");
getchar();
return 0;
}