Ejemplo n.º 1
0
        public object Clone()
        {
            PipleData p = new PipleData();

            p._alpha          = this._alpha;
            p._highlightColor = this._highlightColor;
            p._baseColor      = this._baseColor;
            p._startCap       = this._startCap;
            p._endCap         = this._endCap;
            p._lineJoin       = this._lineJoin;
            p._width          = this._width;
            return(p);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 绘制管道
        /// </summary>
        /// <param name="g"></param>
        /// <param name="path"></param>
        public void DrawPath(Graphics g, GraphicsPath path)
        {
            if (IsPiple)
            {
                PipleData pipleData         = PipleData;
                float     tempWidthInterval = pipleData.Width / accuracy;
                float     RInterval         = (pipleData.HighlightColor.R - pipleData.BaseColor.R) / accuracy;
                float     GInterval         = (pipleData.HighlightColor.G - pipleData.BaseColor.G) / accuracy;
                float     BInterval         = (pipleData.HighlightColor.B - pipleData.BaseColor.B) / accuracy;

                Pen p = new Pen(pipleData.BaseColor, pipleData.Width);
                p.StartCap = pipleData.StartCap;
                p.EndCap   = pipleData.EndCap;
                p.LineJoin = pipleData.LineJoin;
                p.Color    = Color.FromArgb(pipleData.Alpha, pipleData.BaseColor);
                for (int i = 0; i < accuracy; i++)
                {
                    g.DrawPath(p, path);
                    p.Width -= tempWidthInterval;
                    p.Color  = Color.FromArgb(pipleData.Alpha, p.Color.R + (int)RInterval, p.Color.G + (int)GInterval, p.Color.B + (int)BInterval);
                }
                p.Dispose();
            }
        }