From 387530c8a9ecbccb20adb9d60b803de2c9588302 Mon Sep 17 00:00:00 2001 From: march3 Date: Fri, 1 Sep 2023 11:51:03 +0800 Subject: [PATCH] =?UTF-8?q?Python=E8=B6=85=E4=BA=BA-=E5=AE=87=E5=AE=99?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/win_pos.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/win_pos.py b/common/win_pos.py index fe8a508..3c248e1 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) -- GitLab