---
id: "T:cAlgo.API.CornerRadius"
kind: "struct"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# CornerRadius (struct)

Represents the radii of a rectangle's corners.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public sealed struct CornerRadius : ValueType
```

## Examples

C#:

```csharp
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)
        {
        }
    }
}
```

Python:

```python
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)
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Constructors

- `public CornerRadius(double topLeft, double topRight, double bottomRight, double bottomLeft)` — Initializes a new instance of the CornerRadius structure. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/Constructor/index.md)
- `public CornerRadius(double uniformRadius)` — Initializes a new instance of the CornerRadius structure. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/Constructor/index.md)

## Properties

- `public double BottomLeft {get; set;}` — Gets or sets the radius of the bottom-left corner. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/BottomLeft/index.md)
- `public double BottomRight {get; set;}` — Gets or sets the radius of the bottom-right corner. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/BottomRight/index.md)
- `public double TopLeft {get; set;}` — Gets or sets the radius of the top-left corner. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/TopLeft/index.md)
- `public double TopRight {get; set;}` — Gets or sets the radius of the top-right corner. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Styles/CornerRadius/TopRight/index.md)

