ComponentFactory.Krypton.Toolkit.RenderStandard.DrawBackRoundedTopLight C# (CSharp) Method

DrawBackRoundedTopLight() private method

private DrawBackRoundedTopLight ( RenderContext context, Rectangle rect, Rectangle gradientRect, Color backColor1, Color backColor2, PaletteColorStyle backColorStyle, float backColorAngle, VisualOrientation orientation, GraphicsPath path ) : void
context RenderContext
rect System.Drawing.Rectangle
gradientRect System.Drawing.Rectangle
backColor1 Color
backColor2 Color
backColorStyle PaletteColorStyle
backColorAngle float
orientation VisualOrientation
path System.Drawing.Drawing2D.GraphicsPath
return void
        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);
                }
            }
        }
RenderStandard