Files
SimpleRemoter/client/ScreenPreview.h
T
yuanyuanxiang 5eb44307ee Feature: Capture the virtual desktop for multi-monitor remote control
The MCP Observe/Act loop requires screenshots and mouse injection to share
one coordinate space. Previously the client sent only the primary monitor
while injection used virtual-desktop coordinates, so multi-monitor hosts
were rejected outright.

- Client: COMMAND_SCREEN_SPY param buffer[11] (wire index 12) now forces
  whole-virtual-desktop GDI capture; preview JPEGs also cover the virtual
  desktop including negative origins.
- Server: advertise CLIENT_CAP_VIRTUAL_DESKTOP, gate multi-monitor remote
  control on that capability, and pass the flag when starting the session.
  Linux stays exempt (X root capture/injection are already consistent).
2026-11-10 08:21:55 +01:00

17 lines
750 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ScreenPreview.h
// 屏幕预览:抓整个虚拟桌面 → 等比缩放 → JPEG 编码,供 COMMAND_SCREEN_PREVIEW_REQ 响应使用。
#pragma once
#include <vector>
// 抓取整个虚拟桌面并编码成 JPEG。
// maxWidth 服务端期望的宽度;客户端按源图宽度等比缩放,不会强制放大
// quality JPEG 质量 1..100(建议 40..85)
// out 编码后的 JPEG 字节流
// outWidth 实际编码图宽
// outHeight 实际编码图高
// 返回 0 表示成功;非 0 见 ScreenPreviewStatus(枚举在 commands.h)
int CaptureAndEncodePreview(int maxWidth, int quality,
std::vector<unsigned char>& out,
int& outWidth, int& outHeight);