User Tools

Site Tools


api:dk11:delphi:gislayerpixel.tgis_layerpixel.locate_tgis_point_tgis_color_tgis_doublearray_boolean

TGIS_LayerPixel.Locate method

DK for Delphi | GisLayerPixel.TGIS_LayerPixel.Locate | Constructors | Fields | Methods | Properties | Events

If a given point is located in the image area, returns true and sets variables.

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

Syntax

// Delphi
public
  function Locate(
    const _ptg : TGIS_Point;
    var _rgbMapped : TGIS_Color;
    var _nativesVals : TGIS_DoubleArray;
    var _transparency : Boolean
  ) : Boolean; virtual;
// C++ Builder
public:
  virtual bool Locate(
    TGIS_Point* const _ptg,
    TGIS_Color* &_rgbMapped,
    TGIS_DoubleArray* &_nativesVals,
    bool &_transparency
  );

Parameters

Name Type Description
_ptg TGIS_Point reference point /searching point/; if the layer has been attached to the Viewer then expected _ptg units are in a Viewer coordinate space; otherwise expected _ptg units are in a Layer coordinate space
_rgbMapped TGIS_Color color in _ptg point after mapping (the same as _nativesVals if no mapping, in this case _rgbMapped and $FF = Byte(_nativesVals[0] and so on).
_nativesVals TGIS_DoubleArray dynamic array of double with original values in _ptg point (for example R, G, B), Length(_nativesVals) is equal to number of bands
_transparency Boolean set on True if point is transparent

Result

Type Description
Boolean True if success

Remarks

same meaning as LocateEx() with _pixelsize=0

Example

Delphi

procedure MyClass.CheckRGB();
var
  ll : TGIS_LayerTIFF ;
  rgbMapped : TRGBTriple ;
  nativesVals : TGIS_DoubleArray ;
  bT : Boolean;
begin
  bt := True;
 
  // let's add a layer
  ll := TGIS_LayerTIFF.Create ;
  ll.Path := 'c:\test\aerial.tif' ;
  GIS.Add(ll) ;
  GIS.FullExtent;
 
  if ll.Locate( GisPoint(10,10),rgbMapped,nativesVals,x ) then begin
    dosomething();
  end ;
 
end;

References

2025/01/31 01:07

Page Tools