Skip to content

PenLineCap

Summary

Describes the shape at the end of a line or segment.

Signature

1
public enum PenLineCap

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
30
31
32
33
34
 using cAlgo.API;
 namespace cAlgo
 {
     // This sample shows how to use the PenLineCap properties of shapes
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class PenLineCapSample : Indicator
     {
         [Parameter("Stroke Start Line Cap", DefaultValue = PenLineCap.Flat)]
         public PenLineCap StrokeStartLineCap { get; set; }
         [Parameter("Stroke End Line Cap", DefaultValue = PenLineCap.Flat)]
         public PenLineCap StrokeEndLineCap { get; set; }
         [Parameter("Stroke Dash Cap", DefaultValue = PenLineCap.Flat)]
         public PenLineCap StrokeDashCap { get; set; }
         protected override void Initialize()
         {
             var rectangle = new Rectangle
             {
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
                 StrokeStartLineCap = StrokeStartLineCap,
                 StrokeEndLineCap = StrokeEndLineCap,
                 StrokeDashCap = StrokeDashCap,
                 StrokeColor = Color.Red,
                 StrokeThickness = 4,
                 Width = 200,
                 Height = 100,
             };
             Chart.AddControl(rectangle);
         }
         public override void Calculate(int index)
         {
         }
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():    
     def initialize(self):
         rectangle = Rectangle()
         rectangle.HorizontalAlignment = HorizontalAlignment.Center
         rectangle.VerticalAlignment = VerticalAlignment.Center
         # StrokeStartLineCap, StrokeEndLineCap, and StrokeDashCap
         # are parameters of type PenLineCap defined in indicator C# file
         rectangle.StrokeStartLineCap = api.StrokeStartLineCap
         rectangle.StrokeEndLineCap = api.StrokeEndLineCap
         rectangle.StrokeDashCap = api.StrokeDashCap
         rectangle.StrokeColor = Color.Red
         rectangle.StrokeThickness = 4
         rectangle.Width = 200
         rectangle.Height = 100
         api.Chart.AddControl(rectangle)

Fields

Flat

Summary

A cap that does not extend past the last point of the line. Comparable to no line cap.

Signature

1
PenLineCap.Flat;

Return Value

PenLineCap

Square

Summary

A rectangle that has a height equal to the line thickness and a length equal to half the line thickness.

Signature

1
PenLineCap.Square;

Return Value

PenLineCap

Round

Summary

A semicircle that has a diameter equal to the line thickness.

Signature

1
PenLineCap.Round;

Return Value

PenLineCap

Triangle

Summary

An isosceles right triangle whose base length is equal to the thickness of the line.

Signature

1
PenLineCap.Triangle;

Return Value

PenLineCap