Fixed the calibration and added the JSON serialising

This commit is contained in:
2023-05-05 15:00:39 +02:00
parent 2c2239427c
commit 16be9bf7ef
13 changed files with 205 additions and 72 deletions

View File

@@ -111,8 +111,24 @@ namespace Test_Merge
}
public virtual Bitmap Draw()
{
Image img = Image;
Bitmap img;
//If its the main zone we want to see everything
if (Zones.Count > 0)
{
img = Image;
}
else
{
img = ZoneImage;
}
Graphics g = Graphics.FromImage(img);
//If its the main zone we need to visualize the Zone bounds displayed
if (Zones.Count > 0)
g.DrawRectangle(new Pen(Brushes.Violet,5),Bounds);
foreach (Zone z in Zones)
{
Rectangle newBounds = new Rectangle(z.Bounds.X,z.Bounds.Y + Bounds.Y,z.Bounds.Width,z.Bounds.Height);
@@ -122,7 +138,19 @@ namespace Test_Merge
{
g.DrawRectangle(Pens.Blue, w.Bounds);
}
return (Bitmap)img;
return img;
}
public void ResetZones()
{
Zones.Clear();
}
public void ResetWindows()
{
foreach (Zone z in Zones)
{
z.ResetWindows();
}
Windows.Clear();
}
public virtual string ToJSON()
{