裁剪左边界退回25%(c9acd7e版),48%只截到自身消息右半边对方消息完全不可见
@@ -592,13 +592,13 @@ class MessageMonitor:
|
|||||||
# 先切 QQ 到前台再截屏,避免 CMD 窗口遮挡→OCR 读到终端文字
|
# 先切 QQ 到前台再截屏,避免 CMD 窗口遮挡→OCR 读到终端文字
|
||||||
self._ensure_foreground(hwnd)
|
self._ensure_foreground(hwnd)
|
||||||
time.sleep(0.15)
|
time.sleep(0.15)
|
||||||
# 左边界 48%(消息面板 ~55-100%,完全避开会话列表 ~30-55%)
|
# 左边界 25%(c9acd7e 版),覆盖联系人列表右缘~消息面板全部
|
||||||
# 38% 还抓到了会话列表右侧的 KB 预览文字(问题1/2…等混入 OCR 文本)
|
# 48% 只截到自身消息右半边,对方消息(消息面板左侧)被切
|
||||||
# 48% 更深入消息面板,只捕获消息正文区域
|
# 25% 从联系人列表右半开始,完全包含消息面板两侧内容
|
||||||
# 右边界 97%(比 95% 宽 2%),减少右侧时间戳被裁成 & 碎片
|
# 用时间戳分割恢复独立消息,不担心会话列表噪声
|
||||||
cap_left = int(left + win_w * 0.48)
|
cap_left = int(left + win_w * 0.25)
|
||||||
cap_top = top + max(40, int(win_h * 0.04)) # 标题栏下方
|
cap_top = top + max(40, int(win_h * 0.04)) # 标题栏下方
|
||||||
cap_right = int(left + win_w * 0.97) # 稍宽避免时间戳裁剪
|
cap_right = int(left + win_w * 0.95) # 跳过滚动条
|
||||||
cap_bottom = bottom - max(100, int(win_h * 0.10)) # 输入框上方
|
cap_bottom = bottom - max(100, int(win_h * 0.10)) # 输入框上方
|
||||||
if cap_right <= cap_left or cap_bottom <= cap_top:
|
if cap_right <= cap_left or cap_bottom <= cap_top:
|
||||||
return []
|
return []
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 19 KiB |