private void DrawBackRoundedTopLight(RenderContext context,
Rectangle rect,
Rectangle gradientRect,
Color backColor1,
Color backColor2,
PaletteColorStyle backColorStyle,
float backColorAngle,
VisualOrientation orientation,
GraphicsPath path)
{
using (Clipping clip = new Clipping(context.Graphics, path))
{
// Draw entire background in white
using(SolidBrush lightBrush = new SolidBrush(ControlPaint.LightLight(backColor1)))
context.Graphics.FillRectangle(lightBrush, rect);
// Offset the drawing rectangle depending on the orientation
switch (orientation)
{
case VisualOrientation.Top:
rect.Y++;
rect.Height--;
break;
case VisualOrientation.Bottom:
rect.Height--;
break;
case VisualOrientation.Left:
rect.X++;
rect.Width--;
break;
case VisualOrientation.Right:
rect.Width--;
break;
}
// Draw the second color as the offset background
using (Brush backBrush = CreateColorBrush(gradientRect,
backColor1,
backColor2,
PaletteColorStyle.Rounded,
backColorAngle,
orientation))
{
context.Graphics.FillRectangle(backBrush, rect);
}
}
}