IWorkspaceBox.ConvertPtToView

Syntax

ConvertPtToView(Pt: IGxPoint): IGxPointF;

Parameters

Pt is the display point coordinates by which it is necessary to get the coordinates in the workspace.

Description

The ConvertPtToView method allows to get point coordinates in the workspace using point display coordinates.

Example

Executing this example requires a form with the WorkspaceBox component named WorkspaceBox1 and theUiWorkspaceObject component or the UiWorkspace component that is a data source for WorkspaceBox1.

Sub WorkspaceBox1OnMouseDown(Sender: Object; Args: IMouseClickEventArgs);

Var

Pt: IGxPoint;

PtF: IGxPointF;

x, y: Double;

Begin

Pt := Args.pPoint As IGxPoint;

PtF := WorkspaceBox1.ConvertPtToView(Pt);

x := PtF.X;

y := PtF.Y;

End Sub WorkspaceBox1OnMouseDown;

If user points the cursor at the workspace and pushes the mouse button after executing this example, the "x" and "y" variables contains the workspace coordinates that were received with the help of mouse cursor display coordinates transformation.

See also:

IWorkspaceBox