opencv 2.2 windows handle different from 2.3 and cvshowimage differences (Bug #1189)


Added by lowe nick over 13 years ago. Updated over 12 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:- % Done:

0%

Category:highgui-gui
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

i use this for having the opencv window as a child window in my mfc aplication.

Basic approach:
-declare a CWnd object in your dialog/view:
CWnd z;

-In the initialization of your dialog/view:

//create an opencv window
cvNamedWindow("windowname", 0); //resizable window;
// get its handle
HWND wnd = (HWND)cvGetWindowHandle("windowname");

// grab the parent of and attach it to your CWnd object
// (a opencv window is composed of an innerwindow and its parent
// frame - you need the handle to the frame)
z.Attach(::GetParent(wnd));

// force the frame to behave as a child of your view
CWnd * old = z.SetParent(this);

// move it wherever you like
z.SetWindowPos(0,100,512,512,0,SWP_NOZORDER|SWP_NOACTIVATE);

// make it look as a child window (it has dialog frame)
z.ModifyStyle(WS_OVERLAPPED | WS_SIZEBOX | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SYSMENU | WS_CAPTION, WS_CHILD);

// from now on you can do almost anything you like on your z object.

// you can draw on your window using opencv commands:
eg. cvShowImage(...)

BUt. it works fine in 2.2 opecv.( shows not as separate window,but as a clild but with 2.3(with qt support) and having the windows to have either the normal or expanded gui,it keeps staynig a separate window. why is that?

and i have problem with imshow. it crashes in 2.2.why? so i use cvShowimage.
and also cv::imshow("windowname", img0); in 2.2 img0 has to be an iplimg but in 2.3 has to be cv array. why the change? and why not say this with large letters somewhere???
its not nice coding not to be backwards supporting


Associated revisions

Revision 95bdd4b6
Added by Roman Donchenko over 11 years ago

Merge pull request #1189 from pengx17:2.4_sort_by_key

History

Updated by Vadim Pisarevsky over 13 years ago

turn off qt support. Qt and MFC are two different incompatible toolkits

  • Status changed from Open to Done
  • (deleted custom field) set to worksforme

Updated by Andrey Kamaev over 12 years ago

  • Category changed from highgui-images to highgui-gui

Also available in: Atom PDF