Improved the old way of manually selecting windows, Added all the windows types and implemented them, You can now export to a bad json file
This commit is contained in:
+18
-2
@@ -114,7 +114,7 @@ namespace OCR_tester
|
||||
Size newSize = new Size(zonePoints[1].X - zonePoints[0].X, zonePoints[1].Y - zonePoints[0].Y);
|
||||
mainZone = new MainZone(fullImage, new Rectangle(zonePoints[0], newSize));
|
||||
pbxInput.Image = mainZone.Draw();
|
||||
pbxWindow.Image = mainZone.Zones[0].ZoneImage;
|
||||
pbxWindow.Image = mainZone.Zones[1].ZoneImage;
|
||||
SwitchCreateZoneButton();
|
||||
}
|
||||
else
|
||||
@@ -150,7 +150,7 @@ namespace OCR_tester
|
||||
z.AddWindow(new Rectangle(position,newSize));
|
||||
}
|
||||
pbxInput.Image = mainZone.Draw();
|
||||
pbxWindow.Image = mainZone.Zones[0].Draw();
|
||||
pbxWindow.Image = mainZone.Zones[1].Draw();
|
||||
SwitchCreateWindowButton();
|
||||
}
|
||||
else
|
||||
@@ -164,5 +164,21 @@ namespace OCR_tester
|
||||
{
|
||||
reload();
|
||||
}
|
||||
|
||||
private void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
string path = @"C:\Users\Moi\Desktop\imgDump\";
|
||||
string name = "Dump.json";
|
||||
if (File.Exists(path + name))
|
||||
{
|
||||
File.Delete(path+name);
|
||||
}
|
||||
using (StreamWriter writer = new StreamWriter(path+name))
|
||||
{
|
||||
writer.WriteLine("{");
|
||||
writer.WriteLine(mainZone.ToJSON());
|
||||
writer.WriteLine("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user