mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-12 08:55:14 +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);
|
||||
if (matchPosition != Point.Empty)
|
||||
{
|
||||
string text;
|
||||
string text = "";
|
||||
if (isOCR128)
|
||||
{
|
||||
text = OCR((Bitmap)mainImage.Clone(), matchPosition.X, matchPosition.Y, imageWidth, imageHeight, 128, 128);
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "";
|
||||
parent.Log("Trying OCR...");
|
||||
|
||||
try {
|
||||
text = OCR((Bitmap)mainImage.Clone(), matchPosition.X, matchPosition.Y, imageWidth, imageHeight, 128, 128);
|
||||
parent.Log("Done OCR.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
parent.Log($"Error in OCR: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
results.Add(new ScreenMatchResult
|
||||
|
|
Loading…
Reference in New Issue
Block a user