diff --git a/common/win_pos.py b/common/win_pos.py index fe8a5089e4727ef639c5a3ec6db906d92c9b3b31..3c248e1334d8649671a85df57e42f72188c70039 100644 --- a/common/win_pos.py +++ b/common/win_pos.py @@ -6,6 +6,8 @@ # link :https://gitcode.net/pythoncr/ # python_version :3.8 # ============================================================================== +import math + import win32con import win32gui import win32api @@ -56,6 +58,13 @@ def set_pycharm_win_pos(): rect = get_win_pos() print("宇宙模拟器窗口", rect) + scale = 1.25 + # C:\Users\Administrator\AppData\Local\EVCapture\conf + print("EV录屏", (math.ceil(rect[0] * scale), + math.ceil(rect[1] * scale), + math.floor(rect[2] * scale - rect[0] * scale), + math.floor(rect[3] * scale - rect[1] * scale))) + rect = (rect[0] - border["l"], rect[1] - border["t"], rect[2] + border["r"], @@ -67,4 +76,13 @@ def set_pycharm_win_pos(): if __name__ == '__main__': + # 0 0 1920 1080 + # Pycharm 窗口 (-7, -7, 1543, 831) + # Pycharm 窗口 (-6, 0, 1543, 830) set_pycharm_win_pos() + # rect = get_win_pos(None) + # rect = (rect[0] * 1.25, + # rect[1] * 1.25, + # rect[2] * 1.25, + # rect[3] * 1.25) + # print("Pycharm 窗口", rect)