Now the OCR applies and only crashes sometimes. But its complete trash and the images cant change for whatever reason

This commit is contained in:
2023-05-10 16:00:01 +02:00
parent df9231aed6
commit 2c1340780e
7 changed files with 138 additions and 18 deletions
+16 -4
View File
@@ -34,7 +34,6 @@ namespace Test_Merge
{
List<Zone> mainZones = new List<Zone>();
Bitmap fullImage = image;
List<string> drivers;
Zone mainZone;
try
@@ -56,7 +55,7 @@ namespace Test_Merge
Point MainPosition = new Point(mainProperty.GetProperty("x").GetInt32(), mainProperty.GetProperty("y").GetInt32());
Size MainSize = new Size(mainProperty.GetProperty("width").GetInt32(), mainProperty.GetProperty("height").GetInt32());
Rectangle MainRectangle = new Rectangle(MainPosition, MainSize);
mainZone = new Zone(image, MainRectangle,"Main");
mainZone = new Zone(fullImage, MainRectangle,"Main");
var zones = mainProperty.GetProperty("Zones");
var driverZone = zones[0].GetProperty("DriverZone");
@@ -155,7 +154,7 @@ namespace Test_Merge
/// </summary>
/// <param name="idImage">The id of the image we are working with</param>
/// <returns>a string representation of all the returns</returns>
public async Task<string> Decode(List<Zone> mainZones,List<string> drivers)
public async Task<string> Decode(List<Zone> mainZones,List<string> drivers, Bitmap imageToDecode)
{
string result = "";
List<DriverData> mainResults = new List<DriverData>();
@@ -167,9 +166,14 @@ namespace Test_Merge
{
case 0:
//Main Zone
int driverID = 0;
foreach (Zone z in mainZones[mainZoneId].Zones)
{
mainResults.Add(await z.Decode(Drivers));
driverID++;
if (driverID == 9)
Console.WriteLine("AAAAA");
z.ZoneImage.Save("PUTAIN_DE_PILOTE_N"+driverID+".png");
mainResults.Add(await z.Decode(drivers));
}
break;
//Next there could be a Title Zone and TrackInfoZone
@@ -185,6 +189,14 @@ namespace Test_Merge
return result;
}
public void ChangeImage(Bitmap Image)
{
foreach (Zone BigZone in MainZones)
{
BigZone.Image = Image;
}
}
/// <summary>
/// Method that can be used to convert an amount of miliseconds into a more readable human form
/// </summary>