ComponentFactory.Krypton.Toolkit.KryptonSparkleRenderer.DrawContextMenuHeader C# (CSharp) Method

DrawContextMenuHeader() private method

private DrawContextMenuHeader ( Graphics g, ToolStripItem item ) : void
g System.Drawing.Graphics
item System.Windows.Forms.ToolStripItem
return void
        private void DrawContextMenuHeader(Graphics g, ToolStripItem item)
        {
            // Get the rectangle that is the items area
            Rectangle itemRect = new Rectangle(Point.Empty, item.Bounds.Size);

            // Create border and clipping paths
            using (GraphicsPath borderPath = CreateBorderPath(itemRect, _cutToolItemMenu),
                                insidePath = CreateInsideBorderPath(itemRect, _cutToolItemMenu),
                                  clipPath = CreateClipBorderPath(itemRect, _cutToolItemMenu))
            {
                // Clip all drawing to within the border path
                using (Clipping clipping = new Clipping(g, clipPath))
                {
                    // Draw the entire background area first
                    using (SolidBrush backBrush = new SolidBrush(KCT.ToolStripDropDownBackground))
                        g.FillPath(backBrush, borderPath);

                    // Draw the border
                    using (Pen borderPen = new Pen(KCT.MenuBorder))
                        g.DrawPath(borderPen, borderPath);
                }
            }
        }