private GraphicsPath CreateBorderPath(Rectangle rect)
{
GraphicsPath path = new GraphicsPath();
switch (_alignment)
{
case PaletteRelativeAlign.Near:
path.AddLine(rect.Left, rect.Bottom - 1, rect.Left, rect.Top);
path.AddLine(rect.Left, rect.Top, rect.Right - 2, rect.Top);
path.AddLine(rect.Right - 2, rect.Top, rect.Right - 1, rect.Top + 1);
path.AddLine(rect.Right - 1, rect.Top + 1, rect.Right - 1, rect.Bottom - 1);
path.AddLine(rect.Right - 1, rect.Bottom - 1, rect.Left, rect.Bottom - 1);
path.CloseFigure();
break;
case PaletteRelativeAlign.Far:
path.AddLine(rect.Left, rect.Top, rect.Right - 1, rect.Top);
path.AddLine(rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom - 2);
path.AddLine(rect.Right - 1, rect.Bottom - 2, rect.Right - 2, rect.Bottom - 1);
path.AddLine(rect.Right - 2, rect.Bottom - 1, rect.Left, rect.Bottom - 1);
path.AddLine(rect.Left, rect.Bottom - 1, rect.Left, rect.Top);
path.CloseFigure();
break;
case PaletteRelativeAlign.Center:
path.AddLine(rect.Left, rect.Top, rect.Right - 1, rect.Top);
path.AddLine(rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom - 1);
path.AddLine(rect.Right - 1, rect.Bottom - 1, rect.Left, rect.Bottom - 1);
path.AddLine(rect.Left, rect.Bottom - 1, rect.Left, rect.Top);
path.CloseFigure();
break;
}
return path;
}