Image


Summary

Represents the image chart control.

Syntax

public class Image : ControlBase

Members

NameTypeSummary
Image MethodInitializes a new instance of the Image class.
Source PropertyGets or sets the source of the image.
Stretch PropertyGets or sets a value that describes how an Image should be stretched to fill the destination rectangle.
StretchDirection PropertyGets or sets a value that indicates how the image is scaled.

Example 1

using cAlgo.API;
namespace cAlgo
{
    // This sample shows how to use image control to show images
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class ImageSample : Indicator
    {
        protected override void Initialize()
        {
            var image = new Image
            {
                // Logo is an icon file inside project resources
                Source = Properties.Resources.Logo,
                Width = 200,
                Height = 200,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
            };
            Chart.AddControl(image);
        }
        public override void Calculate(int index)
        {
        }
    }
}
Reference