示例#1
0
        private void DrawAction(Designflow.Action A, bool isText, Pen pen)
        {
            Graphics graph = Pic.CreateGraphics();

            for (int i = 1; i < A.P.Count; i++)
            {
                if (i == A.P.Count - 1)
                {
                    // pen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
                    int des = 0;
                    graph.DrawLine(pen, A.P[i - 1], A.P[i]);
                    //graph1.DrawLine(pen, A.P[i - 1], A.P[i]);
                    if (A.P[i - 1].X == A.P[i].X)
                    {
                        if (A.P[i - 1].Y > A.P[i].Y)
                        {
                            des = 0;
                        }
                        else
                        {
                            des = 1;
                        }
                    }
                    else if (A.P[i - 1].Y == A.P[i].Y)
                    {
                        if (A.P[i - 1].X > A.P[i].X)
                        {
                            des = 2;
                        }
                        else
                        {
                            des = 3;
                        }
                    }
                    DrawArrow(pen, A.P[i], des);
                }
                else
                {
                    graph.DrawLine(pen, A.P[i - 1], A.P[i]);
                    //graph1.DrawLine(pen, A.P[i - 1], A.P[i]);
                }
                if (pen.Color == Color.Red || pen.Color == this.BgC)
                {
                    if (A.P[i].X == A.P[i - 1].X)
                    {
                        graph.DrawRectangle(pen, new Rectangle(new Point(A.P[i].X - 2, (A.P[i].Y + A.P[i - 1].Y) / 2), new Size(4, 4)));
                    }
                    else if (A.P[i].Y == A.P[i - 1].Y)
                    {
                        graph.DrawRectangle(pen, new Rectangle(new Point((A.P[i - 1].X + A.P[i].X) / 2, A.P[i].Y - 2), new Size(4, 4)));
                    }
                    if (i == 1)
                    {
                        graph.DrawRectangle(pen, new Rectangle(new Point(A.P[i - 1].X - 2, A.P[i - 1].Y - 2), new Size(4, 4)));
                    }
                }
            }
        }
示例#2
0
        private void DrawAction(Designflow.Action A, bool isText)
        {
            Pen pen = new Pen(brush, linewidth);

            DrawAction(A, false, pen);
        }