Sub DrawArrowHeadLine2(cvs As Canvas, x1 As Float, y1 As Float, x2 As Float, y2 As Float, col As Int, StrokeWidth As Int, ArrowLength As Int, HalfArrowWidth As Int, ArrowStartLine As Boolean, StartArrowFilled As Boolean, ArrowEndLine As Boolean, EndArrowFilled As Boolean)
Dim Angle As Double
Dim path1 As Path
Dim x11, y11, x21, y21 As Int
Angle = ATan2D((y2 - y1), (x2 - x1))
x11 = x1
y11 = y1
x21 = x2
y21 = y2
If ArrowStartLine = True Then
If StartArrowFilled = False Then
x11 = x1 + ArrowLength * CosD(Angle)
y11 = y1 + ArrowLength * SinD(Angle)
End If
path1.Initialize(x1, y1)
path1.LineTo(x1 + ArrowLength * CosD(Angle) + HalfArrowWidth * SinD(Angle), y1 + ArrowLength * SinD(Angle) - HalfArrowWidth * CosD(Angle))
path1.LineTo(x1 + ArrowLength * CosD(Angle) - HalfArrowWidth * SinD(Angle), y1 + ArrowLength * SinD(Angle) + HalfArrowWidth * CosD(Angle))
path1.LineTo(x1, y1)
cvsMain.DrawPath(path1, col, StartArrowFilled, StrokeWidth)
End If
If ArrowEndLine = True Then
If EndArrowFilled = False Then
x21 = x2 - ArrowLength * CosD(Angle)
y21 = y2 - ArrowLength * SinD(Angle)
End If
path1.Initialize(x2, y2)
path1.LineTo(x2 - ArrowLength * CosD(Angle) + HalfArrowWidth * SinD(Angle), y2 - ArrowLength * SinD(Angle) - HalfArrowWidth * CosD(Angle))
path1.LineTo(x2 - ArrowLength * CosD(Angle) - HalfArrowWidth * SinD(Angle), y2 - ArrowLength * SinD(Angle) + HalfArrowWidth * CosD(Angle))
path1.LineTo(x2, y2)
cvsMain.DrawPath(path1, col, EndArrowFilled, StrokeWidth)
End If
cvsMain.DrawLine(x11, y11, x21, y21, col, StrokeWidth)
End Sub