Skip to content

Polygon

Summary

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

Signature

1
public class Polygon : Shape

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
28
29
 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)
         {
         }
     }
 }

Properties

Points

Summary

Gets or sets a collection that contains the vertex points of the polygon.

Signature

1
public Point[] Points {get; set;}

Return Value

Point[]

FillRule

Summary

Gets or sets a FillRule enumeration that specifies how the interior fill of the shape is determined.

Signature

1
public FillRule FillRule {get; set;}

Return Value

FillRule

Related Tutorials