---
id: "P:cAlgo.API.Image.StretchDirection"
kind: "property"
type: "T:cAlgo.API.Image"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Image/StretchDirection/"
---

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

# Image.StretchDirection

Member of [Image](https://help.ctrader.com/ctrader-algo/references/Controls/Image/index.md).

## StretchDirection

Gets or sets a value that indicates how the image is scaled.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Accepted without error but never displayed, so control events such as Click are never raised.
- Cloud: Accepted without error but never displayed, so control events such as Click are never raised.

C#:

```csharp
public StretchDirection StretchDirection {get; set;}
```

Python:

```python
image.StretchDirection: StretchDirection
```

### Returns

`StretchDirection` — 

### Examples

C#:

```csharp
var image = new Image { Width = 300, Height = 300, StretchDirection = StretchDirection.DownOnly };
image.Source = new SvgIcon("<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><circle cx='8' cy='8' r='6' fill='#E74C3C'/></svg>");
Chart.AddControl(image);
```

Python:

```python
image = Image()
image.Width = 300
image.Height = 300
image.StretchDirection = StretchDirection.DownOnly
image.Source = SvgIcon("<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><circle cx='8' cy='8' r='6' fill='#E74C3C'/></svg>")
api.Chart.AddControl(image)
```

