Front-end
Mac
Mac
  • README
  • ScreenCaptureKit
    • API
      • SCShareableContent
        • [检索共享内容]Retrieving shareable content
        • [共享内容对象]Inspecting shareable content
        • [类型方法]Type Methods
      • Content capture[内容捕获]
        • SCStream[流]
        • SCStreamConfiguration
        • SCContentFilter
        • CSStreamDeleagate
        • SCScreenshotmanger
      • output processing [输出程序]
        • SCStreamOutput
        • SCStreamOutputType
        • SCStreamFrameInfo
        • SCFrameStatus
      • system content-sharing picker[系统内容共享选择器]
        • SCContentSharingPicker
        • SCContentSharingPickerConfiguration
        • SCContentSharingPickerMode
        • SCContentSharingPickerObserver
      • Stream errors
        • SCStreamError
  • Project
    • cut studio
  • issue
    • issue
  • 额外工具
    • Create-dmg
Powered by GitBook
On this page
  1. ScreenCaptureKit
  2. API
  3. Content capture[内容捕获]

SCScreenshotmanger

用来开发截图工具的好方法


@available(macOS 14.0, *)
open class SCScreenshotManager : NSObject {

// Individual frame capture 独立帧捕获
    
    //  返回CMSampleBuffer对象,通过使用filter和configuration
    @available(macOS 14.0, *)
    open class func captureSampleBuffer(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration, completionHandler: ((CMSampleBuffer?, (any Error)?) -> Void)? = nil)
    @available(macOS 14.0, *)
    open class func captureSampleBuffer(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration) async throws -> CMSampleBuffer

    // 返回一个CGImage对象,是RGBA的格式
    @available(macOS 14.0, *)
    open class func captureImage(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration, completionHandler: ((CGImage?, (any Error)?) -> Void)? = nil)
    @available(macOS 14.0, *)
    open class func captureImage(contentFilter: SCContentFilter, configuration config: SCStreamConfiguration) async throws -> CGImage
}
PreviousCSStreamDeleagateNextoutput processing [输出程序]

Last updated 1 year ago