裁剪退回c9acd7e版: cap_left=0.25, cap_top=0.04, cap_bottom=0.10. 42%+45%只截到bot自身消息右侧, 对方消息被切; md过滤+滚底保留负责拦截md内容和避旧堆
This commit is contained in:
+6
-6
@@ -663,12 +663,12 @@ class MessageMonitor:
|
||||
win32gui.PostMessage(hwnd, win32con.WM_KEYUP, win32con.VK_END, 0)
|
||||
time.sleep(0.3)
|
||||
# TIM 窗口布局: ~5-30% 左栏, ~30-50% 会话列表(含文档预览), ~50-100% 消息面板
|
||||
# 42% 从消息面板左边缘开始,避免会话列表的文档预览混入 OCR
|
||||
# cap_top 放宽到 45%,避免切到消息上半部分(62% 时切了 @消息)
|
||||
cap_left = int(left + win_w * 0.42)
|
||||
cap_top = top + int(win_h * 0.45) # 底部 55%,从 45% 开始
|
||||
cap_right = int(left + win_w * 0.95) # 跳过滚动条
|
||||
cap_bottom = bottom - max(60, int(win_h * 0.08)) # 输入框上方
|
||||
# 退回 c9acd7e 裁剪: 25% 覆盖消息面板两侧(对方+自己消息都可见)
|
||||
# md 过滤负责拦截 bot 的 md 格式回复,裁剪不用太紧
|
||||
cap_left = int(left + win_w * 0.25)
|
||||
cap_top = top + max(40, int(win_h * 0.04)) # 标题栏下方
|
||||
cap_right = int(left + win_w * 0.95) # 跳过滚动条
|
||||
cap_bottom = bottom - max(100, int(win_h * 0.10)) # 输入框上方
|
||||
if cap_right <= cap_left or cap_bottom <= cap_top:
|
||||
return []
|
||||
im = ImageGrab.grab(bbox=(cap_left, cap_top, cap_right, cap_bottom))
|
||||
|
||||
Reference in New Issue
Block a user