mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 13:11:03 +00:00
Update ScreenMatch.cs
This commit is contained in:
parent
2f4b95313f
commit
db557015fd
|
@ -299,14 +299,19 @@ public class ScreenMatch
|
||||||
Point matchPosition = FindTemplate(_mainImage, (Bitmap)image.Clone(), out double maxCorrelation);
|
Point matchPosition = FindTemplate(_mainImage, (Bitmap)image.Clone(), out double maxCorrelation);
|
||||||
if (matchPosition != Point.Empty)
|
if (matchPosition != Point.Empty)
|
||||||
{
|
{
|
||||||
string text;
|
string text = "";
|
||||||
if (isOCR128)
|
if (isOCR128)
|
||||||
{
|
{
|
||||||
text = OCR((Bitmap)mainImage.Clone(), matchPosition.X, matchPosition.Y, imageWidth, imageHeight, 128, 128);
|
parent.Log("Trying OCR...");
|
||||||
}
|
|
||||||
else
|
try {
|
||||||
{
|
text = OCR((Bitmap)mainImage.Clone(), matchPosition.X, matchPosition.Y, imageWidth, imageHeight, 128, 128);
|
||||||
text = "";
|
parent.Log("Done OCR.");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
parent.Log($"Error in OCR: {ex.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
results.Add(new ScreenMatchResult
|
results.Add(new ScreenMatchResult
|
||||||
|
|
Loading…
Reference in New Issue
Block a user