Posted on 2003-12-09
In delphi, we can draw a polygon by using array of TPoint :
Canvas.Polygon(Points: Array of TPoint);
How can we know that a TPoint is "inside" that polygon ? I meant like "hit test" function.
For rectangle (x1,y1,x2,y2), I can use this "If" clause :
// Testing P.X and P.Y
if (P.X >= x1) And (P.Y >= y1) And (P.X <= x2) And (P.Y <= y2) then HIT := TRUE;
Anyone know the algorithm ?