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:
+17
-1
@@ -10,9 +10,12 @@ namespace OCR_tester
|
||||
{
|
||||
public class Window
|
||||
{
|
||||
private Bitmap FullImage;
|
||||
protected Bitmap FullImage;
|
||||
|
||||
private string _name;
|
||||
private Rectangle _bounds;
|
||||
|
||||
public string Name { get => _name; protected set => _name = value; }
|
||||
public Rectangle Bounds { get => _bounds; protected set => _bounds = value; }
|
||||
|
||||
public static DirectoryInfo tessDataFolder = new DirectoryInfo(@"C:\Users\Moi\Pictures\SeleniumScreens\TessData");
|
||||
@@ -27,6 +30,7 @@ namespace OCR_tester
|
||||
return sample;
|
||||
}
|
||||
}
|
||||
|
||||
public Window(Bitmap fullImage, Rectangle bounds)
|
||||
{
|
||||
FullImage = fullImage;
|
||||
@@ -44,5 +48,17 @@ namespace OCR_tester
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
public virtual string ToJSON()
|
||||
{
|
||||
string result = "";
|
||||
|
||||
result += "\"" + Name + "\"" + ":{" + Environment.NewLine;
|
||||
result += "\t" + "\"x\":" + Bounds.X + "," + Environment.NewLine;
|
||||
result += "\t" + "\"y\":" + Bounds.Y + "," + Environment.NewLine;
|
||||
result += "\t" + "\"width\":" + Bounds.Width + Environment.NewLine;
|
||||
result += "}";
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user