IWxView.WorkspaceToView

Syntax

WorkspaceToView(Position: IGxPointF): IGxPointF;

Parameters

Position. Workspace coordinate.

Description

The WorkspaceToView method returns a view coordinate that corresponds to the defined coordinate of the workspace.

Example

Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and a data source for the WorkspaceBox1.

Add links to the Andy, Drawing, Workspace system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    ws: IWxWorkspace;
    view: IWxView;
    PointF: IGxPointF;
    Shape: IWxShape;
    arrow: IWxArrow;
    ellipse: IWxEllipse;
Begin
    // Get workspace for editing
    ws := UiWorkspace1.WxWorkspace;
    view := ws.CreateView;
    view := ws.Views.Item(0);
    ellipse := ws.CreateEllipse;
    arrow := ws.CreateArrow;
    Arrow.FirstPoint := New GxPointF.Create(1010);
    Arrow.LastPoint := New GxPointF.Create(319);
    ellipse := ws.CreateEllipse;
    PointF := New GxPointF.Create(110);
    view.Offset := view.WorkspaceToView(PointF);
End Sub Button1OnClick;

After executing the example a view center offset relative to a workspace is changed.

See also:

IWxView