Ask Your Question

Revision history [back]

Embedded OpenCV Window with Qt Support in MFC

Hello, want to embedded an opencv window with qt support in my mfc application. If i use the non supported .dll in my app everything works fine but need to zoom and shift the image. Because of this, i want to embedded the window with qt support, but when I use the .dll compiled with qt sup. a new window pop up and the picture box in my MFC Dialog ist empty. This is my code to display the Image. In case of the qt sup. the value of hWnd1 is negativ.

cv::namedWindow("Histogram", 1);
HWND hWnd1 = (HWND) cvGetWindowHandle("Histogram");
HWND hParent1 = ::GetParent(hWnd1);
::SetParent(hWnd1, GetDlgItem(IDC_HISTOGRAM)->m_hWnd);
::ShowWindow(hParent1, SW_HIDE);
cv::imshow("Histogram", hist_init);