我正在寻找一种方法,在 Carbon/Cocoa 和 X11 中执行相当于 WindowFromPoint 和 GetWindowRect 的操作。
WindowFromPoint - http://msdn.microsoft.com/en-us/library/ms633558%28VS.85%29.aspx 获取窗口矩形 - http://msdn.microsoft.com/en-us/library/ms633519%28VS.85%29.aspx
最佳答案
I am developing screenshot and screen recording apps …
I want to … determine the bounding rectangle of the window, and then use the coordinates of the window to capture a bitmap of that area of the screen …
肯定使用 Quartz Window Services。
顺便说一句,它的功能之一是您可以单独捕获一个窗口,而不需要在其前面或后面有任何东西。执行此操作时,您不需要获取其矩形。
… and save it to a file …
… or encode it into a video stream.
这部分我不确定。 The sample code on the matter (顾名思义,它使用 OpenGL 进行实际捕获)使用仅 32 位的 QuickTime C API,而不是兼容 64 位的 QuickTime Kit 来编写影片。
关于cocoa - 如何在屏幕上的特定点找到窗口以进行屏幕截图/屏幕录制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2869052/