From f12c6fff888b7fa0516a2c288a8d8e93d4f44673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sun, 26 May 2024 23:17:28 +0800 Subject: [PATCH] screen --- LunaTranslator/LunaTranslator/myutils/ocrutil.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LunaTranslator/LunaTranslator/myutils/ocrutil.py b/LunaTranslator/LunaTranslator/myutils/ocrutil.py index 9afa7c1d..1355b7c2 100644 --- a/LunaTranslator/LunaTranslator/myutils/ocrutil.py +++ b/LunaTranslator/LunaTranslator/myutils/ocrutil.py @@ -92,6 +92,10 @@ def imageCut(hwnd, x1, y1, x2, y2, viscompare=True, rawimage=False) -> QImage: desktop.width(), desktop.height(), ) + x1 = x1 - desktop.x() + y1 = y1 - desktop.y() + x2 = x2 - desktop.x() + y2 = y2 - desktop.y() pix = pix.copy(x1, y1, x2 - x1, y2 - y1) else: pix = screen.grabWindow(