在OSX上用C ++捕获屏幕图像

问题描述 投票:8回答:3

有没有办法以编程方式在mac上截取当前屏幕显示的屏幕截图(或以某种方式访问​​图像)?

优选地,在C ++中,不是Objective-C。

c++ macos screen-capture
3个回答
0
投票

使用screencapture(1)。

http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/screencapture.1.html

使用system()或posix_spawn()调用它。


0
投票

我建议使用Quartz Display Services和函数qazxsw poi


0
投票

我一直在研究同样的问题。这是我在搜索一段时间后想出的代码。

CGDisplayCreateImage()

您必须为CFSTR()提供一个静态字符串。虽然我自己正在寻找将screencapture存储到基于时间戳的文件名的文件的替代方法。

© www.soinside.com 2019 - 2024. All rights reserved.