The mainZone can now calibrate itself and create its own 20 windows without any user input

This commit is contained in:
2023-03-31 13:20:40 +02:00
parent 7292b136de
commit dc6a6ee74d
3 changed files with 51 additions and 15 deletions
+7 -7
View File
@@ -9,11 +9,11 @@ namespace OCR_tester
{
public class Zone
{
private Bitmap FullImage;
private List<Zone> Zones;
private List<Window> Windows;
protected Bitmap FullImage;
protected List<Zone> Zones;
protected List<Window> Windows;
private Rectangle _bounds;
protected Rectangle _bounds;
public Rectangle Bounds { get => _bounds; private set => _bounds = value; }
public Bitmap ZoneImage
@@ -43,12 +43,12 @@ namespace OCR_tester
Zones = new List<Zone>();
Windows = new List<Window>();
}
public void AddZone(Rectangle bounds)
private void AddZone(Rectangle bounds)
{
if(Fits(bounds))
Zones.Add(new Zone(ZoneImage,bounds));
}
public void AddWindow(Rectangle bounds)
private void AddWindow(Rectangle bounds)
{
if (Fits(bounds))
Windows.Add(new Window(ZoneImage,bounds));
@@ -58,7 +58,7 @@ namespace OCR_tester
/// </summary>
/// <param name="InputRectangle">The Rectangle you want to check the fittment</param>
/// <returns></returns>
private bool Fits(Rectangle inputRectangle)
protected bool Fits(Rectangle inputRectangle)
{
if (inputRectangle.X + inputRectangle.Width > Bounds.Width || inputRectangle.Y + inputRectangle.Height > Bounds.Height || inputRectangle.X < 0 || inputRectangle.Y < 0)
{