Skip to content

CornerRadius

struct cAlgo.API

DesktopCLICloud

Represents the radii of a rectangle's corners.

Definition

public sealed struct CornerRadius : ValueType

Namespace: cAlgo.API · Group: Styles

Examples

using cAlgo.API;

namespace cAlgo
{
    // This sample indicator shows how to use the rectangle corner radius to create a round corner rectangle
    public partial class RectangleCornerRadiusSample : Indicator
    {
        protected override void Initialize()
        {
            var rectangle = new Rectangle
            {
                RadiusX = 20,
                RadiusY = 20,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                Width = 200,
                Height = 150,
                FillColor = Color.FromArgb(100, Color.Red),
                StrokeColor = Color.Yellow
            };

            Chart.AddControl(rectangle);
        }

        public override void Calculate(int index)
        {
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        rectangle = Rectangle()
        rectangle.RadiusX = 20
        rectangle.RadiusY = 20
        rectangle.HorizontalAlignment = HorizontalAlignment.Center
        rectangle.VerticalAlignment = VerticalAlignment.Center
        rectangle.Width = 200
        rectangle.Height = 150
        rectangle.FillColor = Color.FromArgb(100, Color.Red)
        rectangle.StrokeColor = Color.Yellow

        api.Chart.AddControl(rectangle)
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Constructors

Name Description
CornerRadius 2 overloadsDesktopCLICloud Initializes a new instance of the CornerRadius structure.

Properties

Name Description
BottomLeftDesktopCLIClouddouble Gets or sets the radius of the bottom-left corner.
BottomRightDesktopCLIClouddouble Gets or sets the radius of the bottom-right corner.
TopLeftDesktopCLIClouddouble Gets or sets the radius of the top-left corner.
TopRightDesktopCLIClouddouble Gets or sets the radius of the top-right corner.