GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoStroke Class / CalculateArrowhead Method
The arrowhead anchor position, giving the spot the arrow is coming from
The arrowhead end point
true if for the "To" end, false if for the "From" end
An array of PointF of at least length four to hold the results
In This Topic
    CalculateArrowhead Method
    In This Topic
    Modify an array of points to hold the four points of a polygon outlining an arrowhead
    Syntax
    public virtual void CalculateArrowhead( 
       PointF anchor,
       PointF endPoint,
       bool atEnd,
       PointF[] poly
    )

    Parameters

    anchor
    The arrowhead anchor position, giving the spot the arrow is coming from
    endPoint
    The arrowhead end point
    atEnd
    true if for the "To" end, false if for the "From" end
    poly
    An array of PointF of at least length four to hold the results
    Remarks

    By default the four points are as follows:

    • [0] the inner point on the shaft, arrow shaft length from the end point
    • [1] and [3] the barbs of the arrowhead, arrow width apart
    • [2] the tip of the arrowhead, at the end point
    If necessary, the length of the arrowhead is actually scaled down to fit in the distance between the anchor and the endPoint.

    This method is normally called by Paint to produce a point array to be passed to DrawArrowhead in the following fashion:

    
                  if (this.ToArrow && this.PointsCount >= 2) {
                    PointF[] toPoly = new PointF[GetArrowheadPointsCount(true)];
                    PointF anchor = this.ToArrowAnchorPoint;
                    PointF end = this.ToArrowEndPoint;
                    CalculateArrowhead(anchor, end, true, toPoly);
                    ... now use the toPoly array ...
                  }
                

    See Also