Example #1
0
        /// <summary>
        /// Отрисовать графики
        /// </summary>
        private void DrawGraphics()
        {
            Graphic[] graphics = parent.Graphics;
            if (graphics != null)
            {
                for (int index = 0; index < graphics.Length; index++)
                {
                    Graphic graphic = graphics[index];
                    if (graphic != null)
                    {
                        //if (graphic.Actived)
                        {
                            //PointF[] pts = graphic.Calculate(point, size, Parent as Panel);
                            PointF[] pts = graphic.CalculateReduce(point, size, Parent as Panel);

                            /*List<PointF[]> pts = graphic.CalculateWithParts(point, size, Parent as Panel);
                             * if (pts != null && pts.Count > 0)
                             * {
                             *  foreach (PointF[] _pts in pts)
                             *  {
                             *      using (Pen pen = new Pen(graphic.Color))
                             *      {
                             *          if (_pts.Length > 1)
                             *          {
                             *              Parent.Drawter.Graphics.DrawLines(pen, _pts);
                             *          }
                             *      }
                             *  }
                             * }*/

                            if (pts != null)
                            {
                                List <Intervals> Intrv = getIntervals(pts);
                                if (Intrv.Count > 0)
                                {
                                    foreach (Intervals i in Intrv)
                                    {
                                        if ((i.end - i.beg) > 0)
                                        {
                                            int      cLng = i.end - i.beg + 1;
                                            PointF[] pts2 = new PointF[cLng];
                                            int      cJ   = i.beg;
                                            for (int j = 0; j < cLng; j++)
                                            {
                                                pts2[j] = pts[cJ++];
                                            }
                                            using (Pen pen = new Pen(graphic.Color, graphic.Width))
                                            {
                                                Parent.Drawter.Graphics.DrawLines(pen, pts2);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }