Drawing an arrow with a sharp end point in C #

I'm going to draw some arrows in mine winform, and I did most of the work. There is only one problem, I can not distinguish between the end of the arrows and the starting point, they are mixed with each other, and it is not clear that where is the starting point of each arrow and where is its end point, I attached an image that shows my problem. I want to know how I can make them sharper or similar (user-friendly) arrows that carry, can easily see arrows. enter image description here As you can see, because the arrows are stepping on each other, their end and beginning are mixed. How can I fix this problem? thanks for the help here is my code

      using (Pen P = new Pen(Color.LightBlue, 3))
            {

                P.StartCap = LineCap.NoAnchor;
                P.EndCap = LineCap.ArrowAnchor;

                for (int i = 0; i < result.Length; i++)
                {
                    int a = (int)result[i] - 65;
                    int b;
                    try
                    {
                        b = (int)result[i + 1] - 65;
                    }
                    catch (Exception)
                    {

                        b = (int)result[0] - 65;
                    }

                   Point startPoint = new Point(_guiLocations[a].X, _guiLocations[a].Y);
                   Point endPoint = new Point(_guiLocations[b].X, _guiLocations[b].Y);
                   pnlView.CreateGraphics().DrawLine(P, startPoint, endPoint);

                }


            }
+4
1

, , , :

    protected override void OnPaint(PaintEventArgs e)
    {
        base.OnPaint(e);

        var nodes = new[] { new Node { Code = 'A', Position = new Point(10, 10) }, new Node { Code = 'B', Position = new Point(45, 45) } };

        using (Pen P = new Pen(Color.LightBlue, 3))
        {

            P.StartCap = LineCap.NoAnchor;
            P.CustomEndCap = new AdjustableArrowCap(4, 8, false);

            for (int i = 0; i < nodes.Length; i++)
            {
                var node = nodes[i];
                for (int j = i; j < nodes.Length; j++)
                {
                    var node2 = nodes[j];

                    if (node == node2)
                        continue;

                    Point startPoint = new Point(node.Position.X, node.Position.Y);
                    Point endPoint = new Point(node2.Position.X, node2.Position.Y);
                    pnlView.CreateGraphics().DrawLine(P, startPoint, endPoint);
                }
            }
        }
        pnlView.PerformLayout();
    }

- Node :

class Node
{
     public char Code { get; set; }
     public Point Position { get; set; }
}

CustomEndCap EndCap:

P.CustomEndCap = new AdjustableArrowCap(4, 8, false);
+3

All Articles