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(0, 129, 255);
Style.ShadowBrushBackColor := New GxColor.CreateRGB(255, 87, 192);
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(0, 129, 255);
Style.ShadowBrushForeColor := Color;
Color.CreateRGB(255, 87, 192);
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.