User Tools

Site Tools


api:dk11:delphi:gisviewer.tgis_viewer.maptoscreenrect_tgis_extent

Table of Contents

TGIS_Viewer.MapToScreenRect method

DK11 for Delphi | GisViewer.TGIS_Viewer.MapToScreenRect | Constructors | Fields | Methods | Properties | Events

Converts rectangle coordinates from map related to screen related.

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

Syntax

Implements IGIS_Viewer.MapToScreenRect.

// Delphi
public
  function MapToScreenRect(
    const _rct : TGIS_Extent
  ) : TRect;
// C++ Builder
public:
  TRect* MapToScreenRect(
    TGIS_Extent* const _rct
  );

Parameters

Name Type Description
_rct TGIS_Extent coordinate in map units

Result

Type Description
TRect Calculated screen rectangle.

Example

Delphi

var
  ptA, ptB : TPoint ;
  ll : TGIS_LayerVector ;
  shp : TGIS_Shape ;
  Rec : TRect;
begin
 
  // let's get a layer
  ll := TGIS_LayerVector( GIS.Get('realpoints') );
 
  // then a shape
  shp := ll.GetShape( _shape.Uid ) ;
 
  // find points
  ptA := _shape.Viewer.MapToScreen( shp.GetPoint( 0, 0 ) ) ;
  ptB := _shape.Viewer.MapToScreen( _shape.GetPoint( 0, 0 ) ) ;
 
  // and rectangle coordinates
  rec := _shape.Viewer.MapToScreenRect (_shape.Extent);
 
  dosomething();
end ;
2022/11/30 19:19

Page Tools