public virtual void DrawBorder(Graphics g, Rectangle rect)
{
// Drawing with anti aliasing to create smoother appearance
using (AntiAlias aa = new AntiAlias(g))
{
Rectangle backRectI = rect;
backRectI.Inflate(1, 1);
// Finally draw the border around the menu item
using (LinearGradientBrush borderBrush = new LinearGradientBrush(backRectI, Border1, Border2, 90f))
{
// Convert the brush to a pen for DrawPath call
using (Pen borderPen = new Pen(borderBrush))
{
// Create border path around the entire item
using (GraphicsPath borderPath = CreateBorderPath(rect, _cutItemMenu))
g.DrawPath(borderPen, borderPath);
}
}
}
}