Пример #1
0
        private void LoadPoints(polyline p, List <DocPoint> listPoints)
        {
            if (p.points == null)
            {
                return;
            }

            string[] points = p.points.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string point in points)
            {
                string[] coords = point.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                DocPoint docPoint = new DocPoint();
                docPoint.X = Double.Parse(coords[0]) / CtlExpressG.Factor;
                docPoint.Y = Double.Parse(coords[1]) / CtlExpressG.Factor;
                listPoints.Add(docPoint);
            }
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="group"></param>
        /// <param name="line"></param>
        /// <param name="prev"></param>
        /// <param name="bold">True for bold; False for regular; null for dash</param>
        private void SaveLine(g group, List <DocPoint> line, DocPoint prev, bool?bold)
        {
            polyline p = new polyline();

            group.polyline.Add(p);

            StringBuilder sb = new StringBuilder();

            if (prev != null)
            {
                sb.Append(prev.X * CtlExpressG.Factor);
                sb.Append(",");
                sb.Append(prev.Y * CtlExpressG.Factor);
                sb.Append(" ");
            }

            foreach (DocPoint docLine in line)
            {
                sb.Append(docLine.X * CtlExpressG.Factor);
                sb.Append(",");
                sb.Append(docLine.Y * CtlExpressG.Factor);
                sb.Append(" ");
            }
            p.points = sb.ToString();
            p.stroke = "black";
            p.fill   = "none";

            if (bold == true)
            {
                if (this.m_format == DiagramFormat.ExpressG)
                {
                    p.stroke_width = "3";
                }
            }
            else if (bold == null)
            {
                p.stroke_dasharray = "1,1";
            }
        }