cocoa - 如何在屏幕上的特定点找到窗口以进行屏幕截图/屏幕录制?

标签 cocoa winapi x11 macos-carbon window-managers

我正在寻找一种方法,在 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 …

使用Quartz Window Services .

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 …

使用CGImageDestination .

… 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/

相关文章:

c++ - C++ 中类型错误的参数

linux - 在 QT5 中使用 qtmotifextension

virtual - ubuntu服务器的虚拟显示器

cocoa - Mac 应用程序沙盒 - NSHomeDirectory() 问题

c++ - 全屏写意

objective-c - Objective C 域驱动设计

c++ - SendNotifyMessage 不发送正确的消息

c - (xlib) 为窗口管理器创建我自己的属性

objective-c - Cocoa 内存问题,从数组中删除对象时内存不会被回收

cocoa - 本地化基于 xib 的现代 Mac 应用程序