的MoveWindow()用C ++缺少的OpenCV 2.3 [英] MoveWindow() missing in C++ OpenCV 2.3

查看:928
本文介绍了的MoveWindow()用C ++缺少的OpenCV 2.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的OpenCV 2.3的C ++版本,我在努力做的一项基本任务。我希望做的就是创建一个窗口,例如使用其移动到特定的位置在屏幕上:

I am using the C++ version of OpenCV 2.3 and am struggling to do a basic task. What I would like to do is create a window and move it to a specific location on the screen using for example:

cv::namedWindow("My Window", 1);
cv::MoveWindow("My Window", 10, 10);

然而,看来这的MoveWindow()功能不可用。来自OpenCV的2.3文档(链接)似乎是C和Python实现,但没有C ++。这是否意味着有一个更好的方式来这样做呢?

However, it appears that the MoveWindow() function is not available. From the OpenCV 2.3 documentation (link) there appears to be C and Python implementations, but no C++. Does this mean there is a better way to be doing this?

从文档的相关部分:

MoveWindow
==========
Moves window to the specified position
--------------------------------------
C: void cvMoveWindow(const char* name, int x, int y)

Python: cv.MoveWindow(name, x, y) → None

Parameters:

- name – Window name
- x – The new x-coordinate of the window
- y – The new y-coordinate of the window


解决:由于OpenCV的最新版本,现在有一个 CV ::的MoveWindow(常量字符串和放大器; winname,诠释的x,int y)对功能。参考这里


RESOLVED: As of the latest version of OpenCV, there is now a cv::MoveWindow("const string& winname, int x, int y) function. Reference here.

推荐答案

您应该使用C函数如下:

You are supposed to use the C function for this:

cvMoveWindow(const char* name, int x, int y);

您可以通过验证下载此信息<一个href=\"http://tenet.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.3/OpenCV-2.3.0.tar.bz2\">OpenCV 2.3 * nix中和下的 C ++样本的目录的OpenCV-2.3.0 /样本/ CPP / tutorial_ code /基本/ 搜索名为 Drawing_1.cpp <文件/ STRONG>。它使用C ++接口的一切.. 除了,移动窗口。

You can verify this info by downloading OpenCV 2.3 for *nix, and under the C++ samples directory OpenCV-2.3.0/samples/cpp/tutorial_code/Basic/ search for a file named Drawing_1.cpp. It uses the C++ interface for everything.. except, moving the window.

看起来像C ++接口没有完成这个任务的方法。

Looks like the C++ interface doesn't have a method for this task.

这篇关于的MoveWindow()用C ++缺少的OpenCV 2.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆