From 65042a7bc805b3a82024767da6db448c55687d50 Mon Sep 17 00:00:00 2001 From: Tian jianyong <11429339@qq.com> Date: Thu, 18 Dec 2025 17:01:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E5=BA=94=E5=B1=8F=E5=B9=95=E5=88=86?= =?UTF-8?q?=E8=BE=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- face_rec.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/face_rec.py b/face_rec.py index 0f9c6bd..61f3b10 100644 --- a/face_rec.py +++ b/face_rec.py @@ -699,16 +699,17 @@ class FaceRecognitionSystem: try: import screeninfo screen = screeninfo.get_monitors()[0] - canvas_width = int(screen.width) - canvas_height = int(screen.height) - x_pos = 0 - y_pos = 0 + # 添加额外边距确保完全覆盖屏幕 + canvas_width = int(screen.width + 40) + canvas_height = int(screen.height + 40) + x_pos = -20 # 负偏移量居中 + y_pos = -20 except Exception as e: self.logger.warning(f"无法获取屏幕信息,使用默认尺寸: {e}") - canvas_width = max(qr_width * 2, 1920) - canvas_height = max(qr_height, 1080) - x_pos = 0 - y_pos = 0 + canvas_width = max(qr_width * 2, 1960) + canvas_height = max(qr_height, 1120) + x_pos = -20 + y_pos = -20 rendered = self._build_qrcode_instruction_canvas(qr_image, (canvas_width, canvas_height)) if rendered is None: