Ask Your Question
0

Alternative of cvGetWindowHandle() in opencv4+

asked 2019-11-06 18:03:10 -0500

Hi. I am using Opencv3.4.8 in my MFC application. I am using cvGetWindowHandle() to get the handle of the window as follows;

namedWindow(windowname, WINDOW_AUTOSIZE);
HWND hWnd = (HWND) cvGetWindowHandle(windowname.c_str());
HWND hParent = ::GetParent(hWnd);
::SetParent(hWnd, GetDlgItem(IDC_PICTURE)->m_hWnd);
::ShowWindow(hParent, SW_HIDE);
CWnd* pWnd = new CWnd();
pWnd->CWnd::Attach(hParent);

Now I want to upgrade to Opencv4+ and there is no cvGetWindowHandle() in Opencv4+. I want to know if there is an alternative function in Opencv4+ and if not how can I do the same task in opencv4+.

Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-11-07 02:08:59 -0500

berak gravatar image

updated 2019-11-07 11:12:58 -0500

#include<opencv2/highgui/highgui_c.h> might still work.

in the long run, the C-api is on the way out, try not to rely on it.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-11-06 18:03:10 -0500

Seen: 22 times

Last updated: Nov 07