Skip to content

CornerRadius

Summary

Represents the radii of a rectangle's corners.

Signature

1
public sealed struct CornerRadius : ValueType

Namespace

cAlgo.API

Methods

Name Description
GetHashCode Returns the hash code for this instance.
Equals Defines whether the specified object is equal to this instance.

Properties

Name Description
TopLeft { get; set; } Gets or sets the radius of the top-left corner.
TopRight { get; set; } Gets or sets the radius of the top-right corner.
BottomRight { get; set; } Gets or sets the radius of the bottom-right corner.
BottomLeft { get; set; } Gets or sets the radius of the bottom-left corner.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample indicator shows how to use the rectangle corner radius to create a round corner rectangle
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public 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)
         {
         }
     }
 }

Last update: June 26, 2022

Comments