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

DrawRibbonTabContextSelectedTop() protected method

Internal rendering method.
protected DrawRibbonTabContextSelectedTop ( Rectangle rect, Color c2, MementoRibbonTabContextSelected cache ) : void
rect System.Drawing.Rectangle
c2 Color
cache MementoRibbonTabContextSelected
return void
        protected virtual void DrawRibbonTabContextSelectedTop(Rectangle rect,
                                                               Color c2,
                                                               MementoRibbonTabContextSelected cache)
        {
            GraphicsPath outsidePath = new GraphicsPath();

            // Create path for a curved dark border around the tab
            outsidePath.AddLine(rect.Left, rect.Bottom - 2, rect.Left + 1, rect.Bottom - 3);
            outsidePath.AddLine(rect.Left + 1, rect.Bottom - 3, rect.Left + 1, rect.Top + 1.5f);
            outsidePath.AddLine(rect.Left + 1, rect.Top + 1.5f, rect.Left + 3, rect.Top);
            outsidePath.AddLine(rect.Left + 3, rect.Top, rect.Right - 4, rect.Top);
            outsidePath.AddLine(rect.Right - 4, rect.Top, rect.Right - 2, rect.Top + 1.5f);
            outsidePath.AddLine(rect.Right - 2, rect.Top + 1.5f, rect.Right - 2, rect.Bottom - 3);
            outsidePath.AddLine(rect.Right - 2, rect.Bottom - 3, rect.Right - 1, rect.Bottom - 2);

            LinearGradientBrush leftBrush = new LinearGradientBrush(rect, Color.FromArgb(125, c2), Color.FromArgb(67, c2), 90f);
            LinearGradientBrush rightBrush = new LinearGradientBrush(rect, Color.FromArgb(16, c2), Color.FromArgb(67, c2), 90f);
            cache.leftPen = new Pen(leftBrush);
            cache.rightPen = new Pen(rightBrush);

            cache.interiorRect = new Rectangle(rect.Left + 2, rect.Top + 3, rect.Width - 4, rect.Height - 3);
            cache.insideBrush = new LinearGradientBrush(rect, Color.FromArgb(134, c2), Color.FromArgb(50, c2), 90f);
            cache.outsidePath = outsidePath;
        }
RenderStandard