/// <summary> /// Takes four parameters that create the location and size of the box, but also gives a generic index. /// </summary> /// <param name="rect"></param> /// <returms></returms> public static DisplayArea CreateDisplay(Rectangle rect) { Point Location = new Point(rect.X, rect.Y); Size Size = new Size(rect.Width, rect.Height); DisplayArea displayArea = new DisplayArea(Location, Size); displayArea.Create(); DisplayAreas.Add(displayArea); displayArea.SetCorners(); return(displayArea); }
/// <summary> /// Creates an imstance of <see cref="DisplayArea "/> and adds it to the <see cref="DisplayAreaManager"/> /// </summary> /// <returms></returms> public static DisplayArea CreateDisplay(Point Location, Size Size) { CreateTime.Start(); DisplayArea displayArea = new DisplayArea(Location, Size); displayArea.Create(); DisplayAreas.Add(displayArea); displayArea.SetCorners(); CreateTime.Stop(); Console.WriteLine("{0} {1} to create box {2}", CheckTime.ElapsedMilliseconds > 0 ? CheckTime.ElapsedMilliseconds : CheckTime.ElapsedTicks, CheckTime.ElapsedMilliseconds > 0 ? "ms" : "ns", DisplayAreas.Count); CreateTime.Reset(); return(displayArea); }