CornerRadius Summary Represents the radii of a rectangle's corners.
Signature
public sealed struct CornerRadius : ValueType
Namespace cAlgo.API
Examples Example 1 (C#) Example 2 (PYTHON)
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 )
{
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 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 )
Methods GetHashCode Summary
Returns the hash code for this instance.
Signature
Return Value
int
Equals (2) Equals (1 of 2)
Summary
Defines whether the specified object is equal to this instance.
Signature
public bool Equals ( CornerRadius other )
Parameters
Name Type Description other CornerRadius The other CornerRadius object to compare with this instance.
Return Value
bool
Equals (2 of 2)
Summary
Defines whether the specified object is equal to this instance.
Signature
public bool Equals ( object obj )
Parameters
Name Type Description obj object The object to compare with this instance.
Return Value
bool
ChangeToZeroIfNegative Signature
private static double ChangeToZeroIfNegative ( double value )
Parameters
Name Type Description value double
Return Value
double
IsEqual Signature
private static bool IsEqual ( double cr1Value , double cr2Value )
Parameters
Name Type Description cr1Value double cr2Value double
Return Value
bool
Properties TopLeft Summary
Gets or sets the radius of the top-left corner.
Signature
public double TopLeft { get ; set ;}
Return Value
double
TopRight Summary
Gets or sets the radius of the top-right corner.
Signature
public double TopRight { get ; set ;}
Return Value
double
BottomRight Summary
Gets or sets the radius of the bottom-right corner.
Signature
public double BottomRight { get ; set ;}
Return Value
double
BottomLeft Summary
Gets or sets the radius of the bottom-left corner.
Signature
public double BottomLeft { get ; set ;}
Return Value
double