Sub canvas_arrow(fromx As Double, fromy As Double, tox As Double, toy As Double)
Dim headlen As Int = 10 ' length of head in pixels
Dim dx As Double = tox - fromx
Dim dy As Double = toy - fromy
Dim angle As Double = ATan2(dy, dx)
Canvas1Ext.beginPath
Canvas1Ext.DrawRect(0, 0, Canvas1.PrefWidth, Canvas1.PrefHeight, fx.Colors.Transparent, True, 0)
Canvas1Ext.moveTo(fromx, fromy)
Canvas1Ext.lineTo(tox, toy)
Canvas1Ext.lineTo(tox - headlen * Cos(angle - cPI / 6), toy - headlen * Sin(angle - cPI / 6))
Canvas1Ext.moveTo(tox, toy)
Canvas1Ext.lineTo(tox - headlen * Cos(angle + cPI / 6), toy - headlen * Sin(angle + cPI / 6))
Canvas1Ext.stroke
Canvas1Ext.closePath
End Sub