mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
Update ocrutil.py
This commit is contained in:
parent
f0b845aa1d
commit
934e3932ff
@ -62,6 +62,11 @@ def imageCut(hwnd, x1, y1, x2, y2, viscompare=True, rawimage=False) -> QImage:
|
|||||||
|
|
||||||
_x1, _y1 = windows.ScreenToClient(hwnd, x1, y1)
|
_x1, _y1 = windows.ScreenToClient(hwnd, x1, y1)
|
||||||
_x2, _y2 = windows.ScreenToClient(hwnd, x2, y2)
|
_x2, _y2 = windows.ScreenToClient(hwnd, x2, y2)
|
||||||
|
|
||||||
|
if not QRect(0, 0, rect[2] - rect[0], rect[3] - rect[1]).contains(
|
||||||
|
QRect(_x1, _y1, _x2 - _x1, _y2 - _y1)
|
||||||
|
):
|
||||||
|
continue
|
||||||
pix = screenshot(_x1, _y1, _x2, _y2, hwnd)
|
pix = screenshot(_x1, _y1, _x2, _y2, hwnd)
|
||||||
if pix.toImage().allGray():
|
if pix.toImage().allGray():
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user