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

Fields

Flat

Summary

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

Signature

1
public static 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
public static PenLineCap Square;

Return Value

PenLineCap

Round

Summary

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

Signature

1
public static PenLineCap Round;

Return Value

PenLineCap

Triangle

Summary

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

Signature

1
public static PenLineCap Triangle;

Return Value

PenLineCap