ArrowHead

function ArrowHead(const arrowTip, controlPt: TPointD; size: double; arrowStyle: TArrowStyle): TArrayOfPointD;


The controlPt's only function is to control the angle of the arrow.


uses
  Image32, Image32_PNG, Image32_Vector, Image32_Draw;
...
var
  img: TImage32;
  pts: array [0..3] of TPointD;
  path, head, tail: TArrayOfPointD;
  lineWidth, arrowHeadSize: integer;
begin
  pts[0] := PointD(20,20);
  pts[1] := PointD(130,20);
  pts[2] := PointD(130,240);
  pts[3] := PointD(240,240);
  lineWidth := 5;
  arrowHeadSize := GetDefaultArrowHeadSize(lineWidth);
  //create a curved path and then shorten it to accommodate arrow heads
  path := FlattenCBezier(pts[0], pts[1], pts[2], pts[3]);
  path := ShortenPath(path, peBothEnds, arrowHeadSize);
  //create the arrow heads
  tail := ArrowHead(pts[0], path[0], arrowHeadSize, asCircle);
  head := ArrowHead(pts[3], path[High(path)], arrowHeadSize, asFancy);

  //draw the path and the arrow heads
  img := TImage32.Create(256,256);
  DrawLine(img, path, lineWidth, clBlack32, esRound);
  DrawLine(img, tail, lineWidth, clBlack32, esClosed);
  DrawLine(img, head, lineWidth, clBlack32, esClosed);
  img.SaveToFile('arrow.png');
  img.Free;