Esempio n. 1
0
        /// <summary>
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <para>
        ///		<paramref name="g"/> is <see langword="null"/>.
        /// </para>
        /// </exception>
        public void DrawRoundBackground(Graphics g, Rectangle bounds, NuGenControlState state, NuGenRoundRectangleStyle style)
        {
            if (g == null)
            {
                throw new ArgumentNullException("g");
            }

            if (bounds.Width > 0 && bounds.Height > 0)
            {
                using (Brush brush = this.GetBackgroundBrush(bounds, state))
                    using (GraphicsPath gp = NuGenControlPaint.GetRoundRectangleGraphicsPath(bounds, _roundRectangleRadius, style))
                    {
                        g.FillPath(brush, gp);
                    }
            }
        }
        /*
         * GetGraphicsPath
         */

        private static GraphicsPath GetGraphicsPath(Rectangle bounds, TickStyle tickStyle)
        {
            switch (tickStyle)
            {
            case TickStyle.TopLeft:
            {
                return(NuGenSmoothTrackBarRenderer.GetTopLeftGraphicsPath(bounds));
            }

            case TickStyle.BottomRight:
            {
                return(NuGenSmoothTrackBarRenderer.GetBottomRightGraphicsPath(bounds));
            }

            default:
            {
                return(NuGenControlPaint.GetRoundRectangleGraphicsPath(bounds, 2));
            }
            }
        }