fix(automation): capture screenshot.window from the composited screen

Blitting from the MainFrame's own wxClientDC clips out child HWNDs, so all of
OrcaSlicer's custom child-window controls (sidebar buttons/combos/panels) and the
GL canvas came back as uninitialized black bitmap memory. Read the window's
on-screen rectangle from the DWM-composited desktop via wxScreenDC instead, which
includes every child window, the OpenGL surface, and ImGui overlays.

Document the visible/unobscured requirement and the HiDPI logical-vs-physical
pixel caveat; clarify how screenshot.viewport3d differs and why it stays.
This commit is contained in:
SoftFever
2026-06-03 17:19:36 +08:00
parent 6980d9c327
commit 952696fd1f
3 changed files with 46 additions and 11 deletions

View File

@@ -59,7 +59,7 @@ def main() -> int:
with open("window.png", "wb") as f:
f.write(orca.screenshot())
with open("preview_3d.png", "wb") as f:
f.write(orca.screenshot_3d(width=1024, height=768))
f.write(orca.screenshot_3d(width=1920, height=1080))
print("wrote window.png and preview_3d.png")
return 0
finally: