Thickness
struct cAlgo.API
DesktopCLICloud
Defines the thickness of the frame around the rectangle.
Definition
public sealed struct Thickness : ValueType
Namespace: cAlgo.API · Group: Controls
Examples
using cAlgo.API;
namespace cAlgo
{
// This sample shows how to use Thickness for defining a chart control margin
public partial class ThicknessSample : Indicator
{
protected override void Initialize()
{
var stackPanel = new StackPanel
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
BackgroundColor = Color.Gold,
Opacity = 0.6
};
var rectangle = new Rectangle
{
StrokeColor = Color.Blue,
FillColor = Color.Red,
StrokeThickness = 2,
Margin = new Thickness(10, 5, 10, 5),
Width = 300,
Height = 100,
};
stackPanel.AddChild(rectangle);
Chart.AddControl(stackPanel);
}
public override void Calculate(int index)
{
}
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def initialize(self):
stackPanel = StackPanel()
stackPanel.BackgroundColor = Color.Gold
stackPanel.HorizontalAlignment = HorizontalAlignment.Center
stackPanel.VerticalAlignment = VerticalAlignment.Center
stackPanel.Opacity = 0.6
rectangle = Rectangle()
rectangle.StrokeColor = Color.Blue
rectangle.FillColor = Color.Red
rectangle.StrokeThickness = 2
rectangle.Margin = Thickness(10, 5, 10, 5)
rectangle.Width = 300
rectangle.Height = 100
stackPanel.AddChild(rectangle)
api.Chart.AddControl(stackPanel)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}
Constructors
| Name | Description |
|---|---|
| Thickness 2 overloadsDesktopCLICloud | Initializes a new instance of the Thickness structure. |
Properties
| Name | Description |
|---|---|
BottomDesktopCLIClouddouble | Gets or sets the thickness of the bottom side of the retangle. |
LeftDesktopCLIClouddouble | Gets or sets the thickness of the left side of the retangle. |
RightDesktopCLIClouddouble | Gets or sets the thickness of the right side of the retangle. |
TopDesktopCLIClouddouble | Gets or sets the thickness of the top side of the retangle. |