public static Region RectanglesToRegion(Rectangle[] rects) { Region reg = new Region (); foreach (Rectangle r in rects) reg.Union(r); return reg; }