Exemplo n.º 1
0
        /// <summary>
        /// 绘制线
        /// </summary>
        /// <param name="g"></param>
        /// <param name="line"></param>
        private void DrawLine(Graphics g, HLine line)
        {
            g.SmoothingMode = SmoothingMode.AntiAlias;
            using (Pen p = new Pen(line.LineColor, line.LineWidth))
            {
                //设置起止点线帽
                p.StartCap = LineCap.Round;
                p.EndCap   = LineCap.Round;

                //设置连续两段的联接样式
                p.LineJoin = LineJoin.Round;
                g.DrawCurve(p, line.PointList.ToArray()); //画平滑曲线
            }
        }