将opencv的窗口嵌入到MFC的picture control中
来源:互联网 发布:淘宝橘子的俄罗斯代购 编辑:程序博客网 时间:2024/06/05 07:27
首先在你的OnInit函数中添加如下
namedWindow("view", WINDOW_AUTOSIZE);HWND hWnd = (HWND) cvGetWindowHandle("view");HWND hParent = ::GetParent(hWnd);::SetParent(hWnd, GetDlgItem(IDC_STATIC_CV)->m_hWnd);::ShowWindow(hParent, SW_HIDE);
cvGetWindowHandle 存在于c风格的highgui.h里
根据在对话框中的PictureControl窗口大小自适应显示
所以,在调用imshow("view", mat) 前最好先加上:
cv::Mat m_dst;
CRect rect;
GetDlgItem(IDC_showImg)->GetClientRect(&rect);
cv::Rect dst(rect.left,rect.top,rect.right,rect.bottom);
cv::resize(mat,m_dst,cv::Size(rect.Width(),rect.Height()));
将图片尺寸先调整为PictureControl大小。
后
imshow("view", mat)
0 0
- 将opencv的窗口嵌入到MFC的picture control中
- OpenCV 2.2版本以上显示图片到 MFC 的 Picture Control 控件中
- OpenCV 2.2版本以上显示图片到 MFC 的 Picture Control 控件中
- 在 MFC 框架中,有什么方法能直接将 OpenCV 2.0 库中 Mat 格式的图片传递到 Picture Control(图片控件)显示?
- MFC中 利用OpenCv显示图片到Picture Control控件
- OpenCV 通过 MFC 的 Picture Control 控件操作图像
- 将MFC dll中的窗口嵌入到工程窗口中
- VS2012中MFC使用Picture Control显示OpenCV处理的图像
- OpenCV2.2版本以上显示图片到MFC 的picture control中
- 将opencv图像嵌入到MFC控件中
- MFC中在picture control中显示图像的方法
- MFC中图片控件Picture Control的使用
- 保存MFC中picture control 控件的图片
- MFC中基础控件的使用之Picture Control
- VS2013 MFC 直接将 OpenCV2.0/3.0 库中的 Mat 结构的图像传递到 Picture Control(图片控件)
- 用OpenCV将图像显示在MFC的窗口中
- OpenCV导入图像显示到MFC的PICTURE控件
- control picture 大小如何设定 mfc MFC中怎么通过程序改变Picture Control控件的大小
- Linux设备模型(热插拔、mdev 与 firmware)
- FZU 1054 阅读顺序 别紧张,很简单
- 前端自动化工具概念
- Multiple annotations found at this line: - The superclass "javax.servlet.http.HttpServlet" was not
- pat甲1066. Root of AVL Tree(AVL树)
- 将opencv的窗口嵌入到MFC的picture control中
- ecshop对接微信小程序接口:获取商品分类
- Linux设备驱动程序学习(19)-USB 驱动程序(四)
- codeforces C. Queue (思维)
- Scikit-learn实战之线性模型
- python网络编程
- 浅谈GCC/Clang生成和链接静态库/动态库
- mysql安装程序出现2502、2503错误解决方法
- align-self