IWxShape.Size

Fore Syntax

Size: IGxSizeF;

Fore Syntax

Size: Prognoz.Platform.Interop.Drawing.GxSizeF;

Description

The Size property determines shape size.

Comments

To determine rotation angle, use the IWxShape.Angle property.

Fore Example

Executing the example requires a form that contains the Button component with the Button1 identifier, the WorkspaceBox component with the WorkspaceBox1 identifier and the UiWorkspaceObject component with the UiWorkspaceObject1 identifier. Set the UiWorkspaceObject1 data source for the WorkspaceBox1 component. The workspace is used as a data source. The example is a handler of the OnClick event for the Button1 component.

Add a link to the Drawing system assembly.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    WS: IWxWorkspace;
    Shape: IWxShape;
    Size: IGxSizeF;
Begin
    WorkspaceBox1.Source := UiWorkspaceObject1 As IWorkspaceSource;
    UiWorkspaceObject1.Active := True;
    WS := WorkspaceBox1.View.Workspace;
    WS.BeginUpdate;
    Shape := WS.Shapes.Item(5);
    Shape.Angle := 40;
    Size := New GxSizeF.Create(4378);
    Shape.Size := Size;
    WS.EndUpdate;
End Sub Button1OnClick;

After executing the example shape size and rotation angle are changed.

Fore.NET Example

Executing the example requires a form containing the button component with the button1 identifier, the workspaceBoxNet component with the workspaceBoxNet1 identifier and the uiWorkspaceObjectNet component with the uiWorkspaceObjectNet identifier. Set the uiWorkspaceObjectNet1 data source for the workspaceBoxNet1 component. The workspace is used as a data source. The example is a handler of the Click event for the button1 component.

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

Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.ExtCtrls;
Imports Prognoz.Platform.Interop.Workspace;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    WS: WxWorkspace;
    Shape: IWxShape;
    SSize: GxSizeF = New GxSizeFClass();
Begin
    workspaceBoxNet1.UiSource := uiWorkspaceObjectNet1 As IUiWorkspaceSource;
    uiWorkspaceObjectNet1.Active := True;
    WS := workspaceBoxNet1.View.Workspace;
    WS.BeginUpdate();
    Shape := WS.Shapes.Item[5];
    Shape.Angle := 40;
    SSize.Create(4378);
    Shape.Size := Size;
    WS.EndUpdate();
End Sub;

After executing the example shape size and rotation angle are changed.

See also:

IWxShape