//播放视频
{
cv::namedWindow("ddd",cv::WINDOW_NORMAL);
mathwnd = (HWND)cvGetWindowHandle("ddd");
HWND hPmathwnd = GetParent(mathwnd );
SetParent(mathwnd, hwnd); //重新设置 cv窗口的父窗口为win32窗口
ShowWindow (hPmathwnd, SW_HIDE);
RECT rect;
GetClientRect(hwnd, &rect);
cv::resizeWindow("ddd", rect.right-rect.left, rect.bottom- rect.top );
cap.open("WIN_20230806Pro.mp4")
while(1)
{
cap >> mat;
cv::imshow("ddd",mat);
UpdateWindow(mathwnd);//关键必须刷新
cv::waitKey(30);
}
}