Skip to content

StretchDirection

Summary

Describes how scaling applies to content and restricts scaling to named axis types.

Signature

1
public enum StretchDirection

Namespace

cAlgo.API

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 shows how to use the StretchDirection
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class StretchDirectionSample : Indicator
     {
         [Parameter("Stretch Direction", DefaultValue = StretchDirection.UpOnly)]
         public StretchDirection StretchDirection { get; set; }
         protected override void Initialize()
         {
             var image = new Image
             {
                 Source = Properties.Resources.ctrader_logo,
                 Width = 200,
                 Height = 200,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 StretchDirection = StretchDirection
             };
             Chart.AddControl(image);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

Fields

UpOnly

Summary

The content scales upward only when it is smaller than the parent. If the content is larger, no scaling downward is performed.

Signature

1
public static StretchDirection UpOnly;

Return Value

StretchDirection

DownOnly

Summary

The content scales downward only when it is larger than the parent. If the content is smaller, no scaling upward is performed.

Signature

1
public static StretchDirection DownOnly;

Return Value

StretchDirection

Both

Summary

The content stretches to fit the parent according to the Stretch mode.

Signature

1
public static StretchDirection Both;

Return Value

StretchDirection