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

DrawDragDockingRoundedMiddle() private method

private DrawDragDockingRoundedMiddle ( RenderContext context, Color inside, Color border, Color active, Color inactive, RenderDragDockingData dragData ) : void
context RenderContext
inside Color
border Color
active Color
inactive Color
dragData RenderDragDockingData
return void
        private void DrawDragDockingRoundedMiddle(RenderContext context,
                                                  Color inside, Color border,
                                                  Color active, Color inactive,
                                                  RenderDragDockingData dragData)
        {
            Color borderColor = (dragData.ActiveMiddle ? active : border);
            Color insideColor = (dragData.ActiveMiddle ? active : inside);
            using (AntiAlias aa = new AntiAlias(context.Graphics))
            {
                using (GraphicsPath borderPath = new GraphicsPath(),
                                    insidePath = new GraphicsPath())
                {
                    // Generate the graphics paths for the border and the inside area which is just inside the border
                    Rectangle rect = dragData.RectMiddle;
                    Rectangle rectInside = new Rectangle(rect.X + 2, rect.Y + 2, rect.Width - 4, rect.Height - 4);
                    DrawDragDockingMiddleLines(borderPath, dragData.RectMiddle, 13);
                    DrawDragDockingMiddleLines(insidePath, rectInside, 9);

                    // Fill the entire border area
                    using (SolidBrush borderBrush = new SolidBrush(Color.FromArgb(196, Color.White)))
                        context.Graphics.FillPath(borderBrush, borderPath);

                    // Fill with gradient the area inside the border
                    RectangleF rectBoundsF = new RectangleF(rect.X - 1, rect.Y - 1, rect.Width + 2, rect.Height + 2);
                    using (LinearGradientBrush insideBrush = new LinearGradientBrush(rectBoundsF, Color.FromArgb(196, Color.White), insideColor, 90))
                    {
                        insideBrush.Blend = _dragRoundedInsideBlend;
                        context.Graphics.FillPath(insideBrush, insidePath);
                    }

                    using (Pen borderPen = new Pen(borderColor))
                    {
                        // Finally draw the actual border
                        context.Graphics.DrawPath(borderPen, borderPath);

                        // Draw the two extra tabs
                        context.Graphics.DrawLine(borderPen, new Point(rect.Right - 2, rect.Bottom - 3), new Point(rect.Right - 2, rect.Bottom - 2));
                        context.Graphics.DrawLine(borderPen, new Point(rect.Right - 10, rect.Bottom - 3), new Point(rect.Right - 10, rect.Bottom - 2));
                        context.Graphics.DrawLine(borderPen, new Point(rect.Right - 3, rect.Bottom - 1), new Point(rect.X + 9, rect.Bottom - 1));
                    }
                }
            }
        }
RenderStandard