Polygon


Summary

Draws a polygon, which is a connected series of lines that form a closed shape.

Syntax

public class Polygon : Shape

Members

NameTypeSummary
FillRule PropertyGets or sets a FillRule enumeration that specifies how the interior fill of the shape is determined.
Points PropertyGets or sets a collection that contains the vertex points of the polygon.
Polygon MethodInitializes a new instance of the Polygon class.

Example 1

using cAlgo.API;
namespace cAlgo
{
    // This sample shows how to draw a Polygon
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class PolygonSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.AddControl(new Polygon
            {
                FillColor = Color.Red,
                Width = 200,
                Height = 100,
                Margin = 10,
                Points = new Point[]
                {
                    new Point(100, 100),
                    new Point(200, 50),
                    new Point(300, 100),
                    new Point(100, 100),
                }
            });
        }
        public override void Calculate(int index)
        {
        }
    }
}
Reference