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

DrawBackRounded4() private method

private DrawBackRounded4 ( 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 DrawBackRounded4(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))
            {
                // Use standard helper routine to create appropriate color brush
                using (Brush backBrush = CreateColorBrush(gradientRect, backColor1, backColor2,
                                                          backColorStyle, backColorAngle, orientation))
                {
                    context.Graphics.FillPath(backBrush, path);
                }

                using (Pen linePen = new Pen(backColor1))
                {
                    // Adjust angle for the orientation
                    switch (orientation)
                    {
                        case VisualOrientation.Left:
                            context.Graphics.DrawLine(linePen, rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom - 1);
                            break;
                        case VisualOrientation.Right:
                            context.Graphics.DrawLine(linePen, rect.Left, rect.Top, rect.Left, rect.Bottom - 1);
                            break;
                        case VisualOrientation.Bottom:
                            context.Graphics.DrawLine(linePen, rect.Left, rect.Top, rect.Right - 1, rect.Top);
                            break;
                        case VisualOrientation.Top:
                            context.Graphics.DrawLine(linePen, rect.Left, rect.Bottom - 1, rect.Right - 1, rect.Bottom - 1);
                            break;
                    }
                }
            }
        }
RenderStandard