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(CommonHelper.WhitenColor(KCT.ToolStripDropDownBackground, 1.02f, 1.02f, 1.02f)))
g.FillPath(backBrush, borderPath);
// Draw the border
using (Pen borderPen = new Pen(KCT.MenuBorder))
g.DrawPath(borderPen, borderPath);
}
}
}