PenLineCap
enum cAlgo.API
DesktopCLICloud
Describes the shape at the end of a line or segment.
Definition
public enum PenLineCap
Namespace: cAlgo.API · Group: Shapes
Examples
using cAlgo.API;
namespace cAlgo
{
// This sample shows how to use the PenLineCap properties of shapes
public partial class PenLineCapSample : Indicator
{
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)
{
}
}
}
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
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)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true,
"Parameters": [
{
"Name": "StrokeStartLineCap",
"DisplayName": "Stroke Start Line Cap",
"Type": "Enum",
"EnumTypeFullName": "cAlgo.API.PenLineCap",
"DefaultValue": "Flat"
},
{
"Name": "StrokeEndLineCap",
"DisplayName": "Stroke End Line Cap",
"Type": "Enum",
"EnumTypeFullName": "cAlgo.API.PenLineCap",
"DefaultValue": "Flat"
},
{
"Name": "StrokeDashCap",
"DisplayName": "Stroke Dash Cap",
"Type": "Enum",
"EnumTypeFullName": "cAlgo.API.PenLineCap",
"DefaultValue": "Flat"
}
]
}
Values
| Name | Value | Description |
|---|---|---|
Flat | 0 | A cap that does not extend past the last point of the line. Comparable to no line cap. |
Square | 1 | A rectangle that has a height equal to the line thickness and a length equal to half the line thickness. |
Round | 2 | A semicircle that has a diameter equal to the line thickness. |
Triangle | 3 | An isosceles right triangle whose base length is equal to the thickness of the line. |