1,在MFC窗体中添加picture control控件,并添加对应的变量名

2,在窗体的初始化窗口中添加:

    namedWindow("show", 0);
    HWND hWnd = (HWND)cvGetWindowHandle("show");
    HWND hParent = ::GetParent(hWnd);
    ::SetParent(hWnd, GetDlgItem(IDC_STATIC)->m_hWnd);
    ::ShowWindow(hParent, SW_SHOW);
    GetDlgItem(IDC_STATIC_CV)->GetClientRect(&m_glb.rectD);        

3,在需要显示窗口的地方添加:

cv::Mat m_dst;
            cv::resize(binaryDiffFrame, m_dst, cv::Size(rectD.Width(), rectD.Height()));
            imshow("view",m_dst);
            waitKey(2);

 来源:https://www.zhihu.com/question/29611790/answer/45068617

 

相关文章:

  • 2022-12-23
  • 2021-05-19
  • 2021-12-28
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-12-08
猜你喜欢
  • 2021-05-12
  • 2022-12-23
  • 2021-07-30
  • 2021-07-18
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案