Ask Your Question

randolf's profile - activity

2015-10-12 02:43:41 -0600 commented question Embedded OpenCV Window with Qt Support in MFC

That's the full code to display the Image in a Picture box. Without QT Support it works fine, but with Qt Support a new image window popped up.

const char * WIN_NAME_CV = "Image Display";
namedWindow(WIN_NAME_CV, CV_WINDOW_KEEPRATIO);
RECT rcDlg;
HWND myhWnd = GetDlgItem(IDC_IMG_DISPLAY)->GetSafeHwnd();
::GetWindowRect(myhWnd, &rcDlg);
int winWidth = rcDlg.right - rcDlg.left;
int winHeight = rcDlg.bottom - rcDlg.top;
HWND hWnd = (HWND)cvGetWindowHandle(WIN_NAME_CV);
HWND hParent = ::GetParent(hWnd);
::SetParent(hWnd, myhWnd);
::ShowWindow(hParent, SW_HIDE); 
cvResizeWindow(WIN_NAME_CV, winWidth, winHeight);
2015-10-12 02:38:36 -0600 commented answer Embedded OpenCV Window with Qt Support in MFC

Hi, I know that i don't need Qt support to use opencv in MFC, but i want to zoom and scale the Image and the QT window support that. I need this only for prototyping so I don't want to implement zooming and scaling by my self.

2015-10-12 02:38:11 -0600 answered a question Embedded OpenCV Window with Qt Support in MFC

Hi, I know that i don't need Qt support to use opencv in MFC, but i want to zoom and scale the Image and the QT window support that. I need this only for prototyping so I don't want to implement zooming and scaling by my self.

2015-10-09 09:28:54 -0600 commented question Embedded OpenCV Window with Qt Support in MFC

I just had a look into the cvGetWindowHandle funktion in window_qt.cpp and the return value is pointer of a QWindow. But how can I embedded a QWindow into a MFC Dialog.

2015-10-09 09:05:33 -0600 commented question Embedded OpenCV Window with Qt Support in MFC

picture control

2015-10-09 06:22:06 -0600 asked a question 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);

Regards