StretchDirection


Summary

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

Syntax

public sealed enum StretchDirection

Members

NameTypeSummary
Both FieldThe content stretches to fit the parent according to the Stretch mode.
DownOnly FieldThe content scales downward only when it is larger than the parent. If the content is smaller, no scaling upward is performed.
UpOnly FieldThe content scales upward only when it is smaller than the parent. If the content is larger, no scaling downward is performed.

Example 1

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)
        {
        }
    }
}
Reference