示例#1
0
            /// <summary>
            /// For arrows on axises
            /// </summary>
            /// <param name="p"></param>
            /// <param name="d"></param>
            private void DrawArrow(XPoint p, Direction d)
            {
                XPoint la = null, ra = null;
                var    len = FractWidth * 0.8;

                switch (d)
                {
                case Direction.X:
                {
                    la = new XPoint((float)(p.FormX - len * .5), (float)(p.FormY + len));
                    ra = new XPoint((float)(p.FormX + len * .5), (float)(p.FormY + len));
                }
                break;

                case Direction.Y:
                {
                    la = new XPoint((float)(p.FormX - len), (float)(p.FormY + len * .5));
                    ra = new XPoint((float)(p.FormX - len), (float)(p.FormY - len * .5));
                }
                break;

                default:
                    return;
                }
                g.DrawLines(pen, new[] { la.Point(), p.Point(), ra.Point(),
                                         new PointF(d == Direction.Y?p.Point().X - (float)(len / 2.0):p.Point().X,
                                                    d == Direction.X ?p.Point().Y - (float)(len / 2.0):p.Point().Y)
                                         , la.Point() });
            }