/* * GetTopLeftGraphicsPath */ private static GraphicsPath GetTopLeftGraphicsPath(Rectangle bounds) { GraphicsPath gp = new GraphicsPath(); Point topCenter = NuGenControlPaint.RectTCCorner(bounds); float rectHeight = bounds.Bottom - NuGenSmoothTrackBarRenderer.GetAsymmetricSliderHeight(bounds); gp.AddLine(bounds.Left, rectHeight, topCenter.X, topCenter.Y); gp.AddLine(topCenter.X, topCenter.Y, bounds.Right, rectHeight); gp.AddArc(bounds.Right - _arcSize, bounds.Bottom - _arcSize, _arcSize, _arcSize, 0, 90); gp.AddArc(bounds.Left, bounds.Bottom - _arcSize, _arcSize, _arcSize, 90, 90); gp.CloseFigure(); return(gp); }
/* * GetBodyGraphicsPath */ private static GraphicsPath GetBodyGraphicsPath(Rectangle bounds, TickStyle tickStyle) { GraphicsPath gp = new GraphicsPath(); switch (tickStyle) { case TickStyle.TopLeft: { float rectHeight = bounds.Bottom - NuGenSmoothTrackBarRenderer.GetAsymmetricSliderHeight(bounds) + 3; Point topCenter = NuGenControlPaint.RectTCCorner(bounds); topCenter.Offset(0, 3); gp.AddLine(bounds.Left, rectHeight, topCenter.X, topCenter.Y); gp.AddLine(topCenter.X, topCenter.Y, bounds.Right, rectHeight); gp.AddLine(bounds.Right, bounds.Bottom - 4, bounds.Left, bounds.Bottom - 4); break; } case TickStyle.BottomRight: { float rectHeight = NuGenSmoothTrackBarRenderer.GetAsymmetricSliderHeight(bounds) - 3; Point bottomCenter = NuGenControlPaint.RectBCCorner(bounds); bottomCenter.Offset(0, -3); gp.AddLine(bounds.Left, bounds.Top + 4, bounds.Right, bounds.Top + 4); gp.AddLine(bounds.Right, rectHeight, bottomCenter.X, bottomCenter.Y); gp.AddLine(bottomCenter.X, bottomCenter.Y, bounds.Left, rectHeight); break; } default: { gp.AddRectangle(Rectangle.Inflate(bounds, 0, -3)); break; } } gp.CloseFigure(); return(gp); }