Fixed the calibration and added the JSON serialising
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user