All Cadcorp SIS API Methods

SetPhotoWorldCentre Method

Description

Sets the centre of the view within the current open Map Frame item.

Syntax

Visual Basic
Public Function SetPhotoWorldCentre( _
   ByVal x As Double, _
   ByVal y As Double, _
   ByVal z As Double _
) As Integer

Parameters

x

The x vector (in Photo world coordinates) between the current centre (x) and the new centre (x) of the Photo view.

y

The y vector (in Photo world coordinates) between the current centre (x) and the new centre (x) of the Photo view.

z
The z vector. Can be set to 0.

Remarks

Use GetPhotoWorldPos to convert paper coordinates to Photo world coordinates. The UpdateItem method must be called after the SetPhotoWorldCentre to see the displacement of the map view in the map window.

Available: GEO D OD OM SISpy

Groups:

Example

The following line of code will move the photo world centre 50 units to the North and East. The map view will be displaced to the Southwest.

SIS.SetPhotoWorldCentre(50, 50, 0)

The following sub procedure will calculate the vector between the current photo world centre and an input coordinate (X, Y). The photo world centre will be moved to the input coordinate (X, Y).

Public Sub SetPhotoCentre(ByVal SIS As Desktop, ByVal X As Double, ByVal Y As Double)
Dim x_PhotoCentre, y_PhotoCentre, x1, y1, x2, y2, z As Double
SIS.SplitExtent(x1, y1, z, x2, y2, z, SIS.GetExtent())
SIS.SplitPos(x_PhotoCentre, y_PhotoCentre, z, SIS.GetPhotoWorldPos((x1 + x2) / 2, (y1 + y2) / 2))
SIS.SetPhotoWorldCentre(x_PhotoCentre + (x_PhotoCentre - X), y_PhotoCentre + (y_PhotoCentre - Y), z)
End Sub