TIEShapeLayer.PointInShape
Declaration
function PointInShape(X, Y: integer; PointBase: TIEPointBase = iepbClientArea): Boolean;
Description
Returns true if the specified point is within the area of the shape (i.e. within the are of the polygon defined by its shape).
PointBase specifies what the type of points X and Y are. The default is iepbClientArea, which means a point within the client area (e.g. as returned by OnMouseMove).
Note: This method will not work with complex shapes (that use multiple polygons)
procedure Tfmain.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if ImageEnView1.CurrentLayer.Kind = ielkShape then
begin
if TIEShapeLayer( ImageEnView1.CurrentLayer ).PointInShape( X, Y ) then
Caption := 'Inside Shape'
else
Caption := 'Outside Shape';
end
else
Caption := 'Not a Shape';
end;
See Also
◼PointInPolygon