【WebRTC】【macOS截屏分享-3】【App Window分享】
界面需要显示当前App window的snapshot时
抓取App窗口内容:
- (CGImageRef) captureAppWindowSnapshot:(int) windowId {
CGImageRef imageRef = CGWindowListCreateImage(CGRectNull,
kCGWindowListOptionIncludingWindow,
windowId,
kCGWindowImageBoundsIgnoreFraming);
if (!imageRef) {
return nullptr;
} else {
return imageRef;
}
}