static Path RectangleToPath(RectangleF rect)
{
Path path = new Path ();
path.Add(new IntPoint(rect.Left * scale, rect.Top * scale));
path.Add(new IntPoint(rect.Right * scale, rect.Top * scale));
path.Add(new IntPoint(rect.Right * scale, rect.Bottom * scale));
path.Add(new IntPoint(rect.Left * scale, rect.Bottom * scale));
path.Add(new IntPoint(rect.Left * scale, rect.Top * scale));
return path;
}