Feature: Add zoom functionality for remote desktop viewer in non-control mode

This commit is contained in:
yuanyuanxiang
2026-05-05 15:09:16 +02:00
parent 6113b4653d
commit a89f8dd28f
2 changed files with 286 additions and 3 deletions

View File

@@ -223,6 +223,20 @@ public:
double m_wZoom=1, m_hZoom=1;
bool m_bMouseTracking = false;
// ========== 局部放大功能 ==========
bool m_bZoomedIn = false; // 是否处于放大状态
CRect m_rcZoomSrc; // 放大区域(原图坐标)
bool m_bSelectingZoom = false; // 是否正在框选
CPoint m_ptZoomStart; // 框选起点(屏幕坐标)
CPoint m_ptZoomCurrent; // 框选当前点(屏幕坐标)
bool m_bZoomDragging = false; // 是否正在拖拽平移
CPoint m_ptZoomDragStart; // 拖拽起点(用于点击检测)
CPoint m_ptZoomDragLast; // 拖拽上一点(用于增量计算)
void ResetZoom(); // 重置放大状态
CPoint ScreenToImage(CPoint pt); // 屏幕坐标转原图坐标
CPoint ImageToScreen(CPoint pt); // 原图坐标转屏幕坐标
CString m_aviFile;
CBmpToAvi m_aviStream;
@@ -302,6 +316,7 @@ public:
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnMouseLeave();
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnCaptureChanged(CWnd* pWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
afx_msg LRESULT OnDisconnect(WPARAM wParam, LPARAM lParam);