public void AddRectangle(RectangleF rect)
{
if (rect.Width == 0 || rect.Height == 0)
return;
Append (rect.X, rect.Y, PathPointType.Start, false);
Append (rect.Right, rect.Y, PathPointType.Line, false);
Append (rect.Right, rect.Bottom, PathPointType.Line, false);
Append (rect.X, rect.Bottom, PathPointType.Line | PathPointType.CloseSubpath, false);
}