4

I have a framegrabber (Silicon Software ) and I managed to show the grabbed images from a pointer in memory buffer using OpenCV.

Now I want to create an application (Win32) and place the openCV window as a child window of the main application window. Anybody has any idea?

3 Answers 3

3

I found the answer, it was soo easy. Just couple of lines of code. here it is :

cv::namedWindow("test",cv::WINDOW_AUTOSIZE);                        
hWnd2 = (HWND) cvGetWindowHandle("test"); 
hParent = ::GetParent(hWnd2);       
::SetParent(hWnd2, hParent); 
::ShowWindow(hParent, SW_HIDE);
Sign up to request clarification or add additional context in comments.

Comments

2

if you want your own window, it's probably better, to skip the whole highgui stuff, and do your own blitting as well.

have a look at the src of cvShowImage(), highgui/src/window_w32.cpp,l 1384, to see, what they're doing here

Comments

0

Don't know exactly what you mean by "child window", but you could grab the pixel information from OpenCV's IplImage format and convert it to whatever format you need it for your window.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.