MoveWindow()在C ++ OpenCV 2.3中缺少 [英] MoveWindow() missing in C++ OpenCV 2.3
问题描述
我使用的是C ++版本的OpenCV 2.3,并努力做一个基本的任务。我想要做的是创建一个窗口,并将其移动到屏幕上的特定位置,例如:
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
RESOLVED:在最新版本的OpenCV中,现在有一个 cv :: MoveWindow(const string& winname, int 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);
您可以通过下载 OpenCV 2.3 for * nix 和 C ++示例目录 OpenCV-2.3.0 / samples / cpp / tutorial_code / Basic /
搜索名为 Drawing_1.cpp 的文件。它使用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屋!