添加一个picture control控件和一个按钮,双击按钮添加点击事件:
更改picture control控件IDC为IDC_PIC
Mat src;
src = imread("E:/中策/0308/030801/1.bmp");
namedWindow("view", WINDOW_NORMAL);
imshow("view", src);
HWND hWnd = (HWND)cvGetWindowHandle("view");
HWND hParent = ::GetParent(hWnd);
CRect rect;
GetDlgItem(IDC_PIC)->GetClientRect(&rect);
cvResizeWindow("view", rect.Width(), rect.Height());
::SetParent(hWnd, GetDlgItem(IDC_PIC)->m_hWnd);
::ShowWindow(hParent, SW_HIDE);