From 511c1e8560e08291e49f56e2b6a5469c6eeaf0ec Mon Sep 17 00:00:00 2001 From: march3 Date: Fri, 1 Sep 2023 12:38:59 +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 | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/common/win_pos.py b/common/win_pos.py index 3c248e1..d867edf 100644 --- a/common/win_pos.py +++ b/common/win_pos.py @@ -59,11 +59,20 @@ def set_pycharm_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))) + + x, y, w, h = (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)) + + area_infos = f"""# EV录屏 ({x}, {y}, {w}, {h}) +Area.rect.h : {h} +Area.rect.w : {w} +Area.rect.x : {x} +Area.rect.y : {y} + """ + + print(area_infos) rect = (rect[0] - border["l"], rect[1] - border["t"], @@ -76,13 +85,20 @@ def set_pycharm_win_pos(): if __name__ == '__main__': - # 0 0 1920 1080 - # Pycharm 窗口 (-7, -7, 1543, 831) - # Pycharm 窗口 (-6, 0, 1543, 830) + # 使用方法: + # 1、运行 win_pos.py,找到 EV录屏 区域 -> EV录屏 (183, 70, 1536, 863) set_pycharm_win_pos() + # 2、打开 C:\Users\Administrator\AppData\Local\EVCapture\conf\Admin.conf + # 修改: + # Area.rect.h : 863 + # Area.rect.w : 1536 + # Area.rect.x : 183 + # Area.rect.y : 70 + # 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