Capture Screen Image in C++ on OSX

后端 未结 3 1004
耶瑟儿~
耶瑟儿~ 2020-12-09 06:31

Is there a way to programatically take a screenshot (or somehow get access to an image) of the current screen display on a mac?

Preferably, in C++, not Objective-C.<

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 06:51

    Use screencapture(1).

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

    Invoke it with system() or posix_spawn().

提交回复
热议问题