在MFC中修改opencv的namedWindow窗口位置
2015-12-04 07:46
267 查看
当在MFC中应用opencv的窗口来显示图片。希望namedWindow创建的窗口能根据需要改变风格:
//by dongchunxiao
cv::namedWindow("windows1",0); //创建一个窗口
HWND hWnd = (HWND)cvGetWindowHandle("windows1");//获取子窗口的HWND
HWND hParentWnd = ::GetParent(hWnd);//获取父窗口HWND。父窗口是我们要用的
::SetWindowPos(hParentWnd,HWND_TOPMOST,100,1,500,500,SWP_NOSIZE | SWP_NOMOVE); //修改窗口为最顶部
//隐藏窗口标题栏
long style = GetWindowLong(hParentWnd,GWL_STYLE);
style &= ~(WS_CAPTION);
// style &= ~(WS_MAXIMIZEBOX);
SetWindowLong(hParentWnd,GWL_STYLE,style);
//改变窗口的位置和大小。这里主要前面的SetWindowPos不能改变位置和大小(为什么?)
::MoveWindow(hParentWnd,10,100,500,500,0);
//by dongchunxiao
cv::namedWindow("windows1",0); //创建一个窗口
HWND hWnd = (HWND)cvGetWindowHandle("windows1");//获取子窗口的HWND
HWND hParentWnd = ::GetParent(hWnd);//获取父窗口HWND。父窗口是我们要用的
::SetWindowPos(hParentWnd,HWND_TOPMOST,100,1,500,500,SWP_NOSIZE | SWP_NOMOVE); //修改窗口为最顶部
//隐藏窗口标题栏
long style = GetWindowLong(hParentWnd,GWL_STYLE);
style &= ~(WS_CAPTION);
// style &= ~(WS_MAXIMIZEBOX);
SetWindowLong(hParentWnd,GWL_STYLE,style);
//改变窗口的位置和大小。这里主要前面的SetWindowPos不能改变位置和大小(为什么?)
::MoveWindow(hParentWnd,10,100,500,500,0);
相关文章推荐
- linux下使用Eclipse编译调试C++ makefile项目
- [IT学习]微软如何做网站内容治理
- CentOS6.6系统下以RPM方式安装mysql-5.7.9
- CentOS+nginx+uwsgi+Python+django 环境搭建
- My way on Linux - [Shell基础] - Bash Shell中判断文件、目录是否存在或者判断其是否具有某类属性(权限)的常用方法
- SEQ!org.apache.hadoop.io.LongWritable"org.apache.hadoop.io.BytesWritable
- Linux的五个查找命令
- Shell编程实例
- LAMP 1.2 Apache编译安装
- linux:/etc/skel 文件夹
- JavaWeb学习总结(三)——Tomcat服务器学习和使用(二)
- ros_hydro_OpenCV_kinect_imageconverter
- ResourceBundle 和 Properties 读取Properties文件注意
- ResourceBundle 和 Properties 读取Properties文件注意
- ResourceBundle 和 Properties 读取Properties文件注意
- linux /etc/group /etc/gshadow文件说明
- linux下为目录和文件设置权限,
- Shell正则表达式学习笔记
- Apache CXF 和 Spring 开发 Web Service 1
- CentOS 6 设置服务开机启动的方式