MetroFramework.Controls.MetroTrackBar.DrawTrackBar C# (CSharp) Method

DrawTrackBar() private method

private DrawTrackBar ( Graphics g, Color thumbColor, Color barColor ) : void
g System.Drawing.Graphics
thumbColor Color
barColor Color
return void
        private void DrawTrackBar(Graphics g, Color thumbColor, Color barColor)
        {
            int TrackX = (((trackerValue - barMinimum) * (Width - 6)) / (barMaximum - barMinimum));

            using (SolidBrush b = new SolidBrush(thumbColor))
            {
                Rectangle barRect = new Rectangle(0, Height / 2 - 2, TrackX, 4);
                g.FillRectangle(b, barRect);

                Rectangle thumbRect = new Rectangle(TrackX, Height / 2 - 8, 6, 16);
                g.FillRectangle(b, thumbRect);
            }

            using (SolidBrush b = new SolidBrush(barColor))
            {
                Rectangle barRect = new Rectangle(TrackX + 7, Height / 2 - 2, Width - TrackX + 7, 4);
                g.FillRectangle(b, barRect);
            }
        }