User Tools

Site Tools


api:dk11:net:tatukgis.ndk.igis_viewer.locate_tpoint_integer

Table of Contents



IGIS_Viewer.Locate(TPoint, int) method

DK for .NET | TatukGIS.NDK.IGIS_Viewer.Locate | Overloads | Methods | Properties

Locates the shape nearest to _pt that is within _prec.

Available also on: Delphi | Java | ActiveX | Python.

Syntax

// C#
public TGIS_ShapeAbstract Locate(
  TPoint _pt,
  int _prec
);
' VisualBasic
Public Function Locate(
  ByVal _pt As TPoint,
  ByVal _prec As Integer
) As TGIS_ShapeAbstract
// Oxygene
public
  function Locate(
    _pt : TPoint;
    _prec : Integer
  ) : TGIS_ShapeAbstract;

Parameters

Name Type Description
_pt TPoint Reference point in screen coordinates, expressed in pixels.
_prec int
Integer
Maximum search distance in pixels.

Result

Type Description
TGIS_ShapeAbstract Located shape, or nil if no shape is found within _prec.

Remarks

USAGE: Find the nearest shape to a screen position within a pixel search tolerance.

shp = GIS.Locate(screen_point, 20)
if shp != None
  # Shape found near the screen point

If locate is called upon active paint operations then result could be null. But Locate and paint process are using the same vector enumerator context.

It is recommended to check InPaint property before calling this Locate.

2026/10/31 23:07

Page Tools