How to take screenshot of obscured window in C++ on Linux

前提是你 提交于 2019-12-06 11:39:00

First of all Qt has this feature. You can use: QScreen::grabWindow. Problem is that documentation says:

Note on X11 that if the given window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.

So this will simplify your code, but obscured parts of window will still remains as a problem. Looks like functionality of x11 won't let to resolve this issue.

There is a good example how to use this feature.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!