WxWorkspace.CreateEllipse

Syntax

CreateEllipse: IWxEllipse;

CreateEllipse(): Prognoz.Platform.Interop.Andy.IWxEllipse;

Description

The CreateEllipse method creates an ellipse.

Example

Executing the example requires that repository contains a workspace with the WSP identifier.

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

Sub Userproc;
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Ellipse: IWxEllipse;
    Style: IWxStyle;
Begin
    // Get workspace
    mb := MetabaseClass.Active;
    wsp := mb.ItemById("WSP").Edit As IWxWorkspace;
    // Get shape
    Ellipse := wsp.CreateEllipse;
    Ellipse.Id := "Ellipse1";
    Ellipse.PinPosition := New GxPointF.Create(12, -10);
    Style := wsp.CreateStyle;
    Style.BackgroundBrushForeColor := GxColor.FromName("Red");
    Style.ShadowBrushForeColor := New GxColor.CreateRGB(0129255);
    Style.ShadowBrushBackColor := New GxColor.CreateRGB(25587192);
    Style.ShadowBrushPattern := GxBrushPattern.Diagonals;
    Ellipse.Style := Style;
    //Save changes
    (Wsp As IMetabaseObject).Save;
End Sub Userproc;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    wsp: IWxWorkspace;
    Ellipse: IWxEllipse;
    Style: IWxStyle;
    GxColor: GxColorClassClass = 
New GxColorClassClass();
    Color: GxColorClass_2 = 
New GxColorClass_2();
Begin
    
// Get workspace
    mb := Params.Metabase; ;
    wsp := mb.ItemById[
"WSP"].Edit() As IWxWorkspace;
    
// Get shape
    Ellipse := wsp.CreateEllipse();
    Ellipse.Id := 
"Ellipse1";
    Ellipse.PinPosition.Create(
12, -10);
    Style := wsp.CreateStyle();
    Style.BackgroundBrushForeColor := GxColor.FromName(
"Red");
    Color.CreateRGB(
0129255);
    Style.ShadowBrushForeColor := Color;
    Color.CreateRGB(
25587192);
    Style.ShadowBrushBackColor := Color;
    Style.ShadowBrushPattern := GxBrushPattern.wbpDiagonals;
    Ellipse.Style := Style;
    
//Save changes
    (Wsp As IMetabaseObject).Save();
End Sub;

After executing the example an ellipse with the defined formatting parameters is created.

See also:

IWxWorkspace