Hi,
How i can know if point is inside polygon or not
Thanks
function PtInPolygon(const Polygon: array of TPoint; const Pt: TPoint): Boolean;
var
Rgn: HRGN;
begin
Rgn := CreatePolygonRgn(Polygon, Length(Polygon), WINDING);
try
Result := PtInRegion(Rgn, Pt.X, Pt.Y);
finally
DeleteObject(Rgn);
end;
end;
BOOL PtInRegion(
HRGN hrgn, // handle of region
int X, // x-coordinate of point
int Y // y-coordinate of point
);
Users browsing this forum: No registered users and 4 guests