1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| // 窗口缩放 // todo:只能宽、高同时缩放 void CYUVPlayerDlg::OnSize(UINT nType, int cx, int cy) { if (!m_fInit) return; // if (cx<=333 || cy <= 343) return;
CDialogEx::OnSize(nType, cx, cy);
CWnd *pWnd = GetDlgItem(IDC_VIDEO); if (pWnd) { pWnd->MoveWindow(0, 0, cx, cy-26-20-21-4-4); pWnd->Invalidate(); pWnd->UpdateData(); } // 最右边的按钮 pWnd = GetDlgItem(m_nStartX[0][10]); if (pWnd) { pWnd->SetWindowPos(NULL,cx-30-2,cy-26-4,0,0,SWP_NOZORDER|SWP_NOSIZE); }
int startx = 2; // 帧数统计 pWnd = GetDlgItem(m_nStartX[0][0]); if (pWnd) { pWnd->SetWindowPos(NULL,startx+m_nStartX[1][0],cy-26-20-21-4,0,0,SWP_NOZORDER|SWP_NOSIZE); } // 滚动条 pWnd = GetDlgItem(m_nStartX[0][1]); if (pWnd) { //pWnd->MoveWindow(startx+0, cy-26-26, cx, cy-26-20-21); //pWnd->Invalidate(); pWnd->SetWindowPos( NULL,startx+m_nStartX[1][1],cy-26-26-4,cx,26,SWP_NOZORDER); } // 水平位置相同的按钮 for (int i = 2; i < 10; i++) { pWnd = GetDlgItem(m_nStartX[0][i]); if (pWnd) { pWnd->SetWindowPos(NULL,startx+m_nStartX[1][i],cy-26-4,0,0,SWP_NOZORDER|SWP_NOSIZE); } } }
|