Post

Replies

Boosts

Views

Activity

how to OSX capture screen at pre-login session
I want to dev a daemon which will capture screen of my OSX at pre login sessionI have try by using Quazt display service (stream) and core graphic framework but it still unavailablemy code using Quartz servicem_isExit = FALSE; m_display = kCGDirectMainDisplay; // 1 m_displayMode = CGDisplayCopyDisplayMode(m_display); if (m_display == NULL) { throw Exception("OSX-Quart service Can not get Display mode ",VF_ERR_SCREEN_MONITOR_OSX_QUART_CREATE); } m_height = CGDisplayModeGetHeight(m_displayMode); m_width = CGDisplayModeGetWidth(m_displayMode); m_stream = CGDisplayStreamCreate(m_display,m_width,m_height,'BGRA',NULL,VncStreamFrameAvailableHandler); if (m_stream == NULL) { throw Exception("OSX-Quart service Can not create Stream",VF_ERR_SCREEN_MONITOR_OSX_QUART_CREATE); }it's always through exception. Another code using Core Graphic frameworkm_mainDisplay = kCGDirectMainDisplay; m_oriImage = CGDisplayCreateImage(m_mainDisplay); if (m_oriImage == NULL) { throw Exception ("Core Graphic Can not Create original Image from display",VF_ERR_SCREEN_MONITOR_OSX_CG_CREATE); } ScreenGetConfigure(m_oriImage); screenData.m_oriImage = m_oriImage; m_oriPixelDataRef = CGDataProviderCopyData(CGImageGetDataProvider(m_oriImage)); if (m_oriPixelDataRef == NULL) { throw Exception ("Core Graphic Can not get pixel data ref",VF_ERR_SCREEN_MONITOR_OSX_CG_CREATE); }Both code is not working at pre-login session.Hope somebody can help me to fix the issueMacBook, OS X El Capitan (10.11)
2
0
1.5k
Nov ’22