OpenCV:如何强制图像窗口出现在其他窗口之上? [英] OpenCV: how to force the image window to appear on top of other windows?
问题描述
使用 cvShowImage
,可以轻松地在 OpenCV 中显示图像.但是,您如何告诉 OpenCV 在每个其他窗口的顶部显示该窗口?
Using cvShowImage
, one can easily show an image in OpenCV. However, how do you tell OpenCV to show the window on top of every other window?
我在显示图像时运行全屏 OpenGL 应用程序.OpenCV 窗口第一次在我的应用程序窗口顶部弹出,但是如果我单击我的应用程序窗口(即,将焦点返回给它),那么我无法让 OpenCV 回到顶部OpenGL 窗口,即使在销毁和重新创建窗口时也是如此.
I run a full screen OpenGL application while showing images. The first time the OpenCV window pops up on top of my application window, but if I click on the window of my application (i.e. give focus back to it), then I can't manage to have the OpenCV come back on top of the OpenGL window, even when destroying and recreating the window.
我每次都想重命名窗口,但还有其他方法吗?
I thought of renaming the window each time, but is there another way to do it?
推荐答案
OpenCV 没有本地方法可以做到这一点(我知道).
答案取决于平台.如果您的目标是 Windows,请查看此答案,然后查看this 和 这个肯定会有用.
The answer is platform dependent. If your target is Windows, check this answer and then this and this will certainly be useful.
如果您使用的是 Linux,则需要查看 OpenCV 是如何编译的,并检查其构建在什么系统上(可能是 GTK+ 2.x).然后,自己做一些研究.
If you are on Linux, you need to take a look at how OpenCV was compiled and check what system its built on (probably GTK+ 2.x). Then, do some research of your own.
这篇关于OpenCV:如何强制图像窗口出现在其他窗口之上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!