
https://github.com/mansya에서 만든 로고 위
마스터는 개발이 일어나고 안정적으로 간주되어서는 안됩니다. 안정적인 릴리스에 태그를 사용하십시오.
Window/Linux/Mac
크로스 플랫폼 화면 및 창 캡처 라이브러리
Linux : sudo apt-get 설치 libxtst-dev libxinerama-dev libx11-dev libxfixes-dev
이미지 형식은 픽셀 당 RAW BGRA 32 비트입니다. Alpha는 사용되는 곳을 제외하고는 OnnewFrame에 사용되지 않으며 onframechanged!
for 루프 [a, r, g, b], [a, r, g, b], [a, r, g, b]로 행진한다면 데이터가 존재합니다. 이것이 왜 여기에 게시물을 확인하는지에 대한 읽기를 참조하십시오.
https://github.com/smasherprog/screen_capture_lite/blob/mas
// Setup Screen Capture for all monitors
auto framgrabber = SL::Screen_Capture::CreateCaptureConfiguration([]() {
// add your own custom filtering here if you want to capture only some monitors
return SL::Screen_Capture::SCL_GetMonitors ();
})-> onFrameChanged ([&]( const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Monitor& monitor) {
})-> onNewFrame ([&]( const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Monitor& monitor) {
})-> onMouseChanged ([&]( const SL::Screen_Capture::Image* img, const SL::Screen_Capture::MousePoint &mousepoint) {
})-> start_capturing ();
framgrabber-> SCL_SetFrameChangeInterval (std::chrono::milliseconds( 100 )); // 100 ms
framgrabber-> SCL_SetMouseChangeInterval (std::chrono::milliseconds( 100 )); // 100 ms
// Setup Screen Capture for windows that have the title "cmake" in it
auto windowframgrabber = SL::Screen_Capture::CreateCaptureConfiguration([]() {
auto windows = SL::Screen_Capture::SCL_GetWindows ();
std::string srchterm = " cmake " ;
// convert to lower case for easier comparisons
std::transform (srchterm. begin (), srchterm. end (), srchterm. begin (), []( char c) { return std::tolower (c, std::locale ());});
decltype (windows) filtereditems;
for ( auto & a : windows) {
std::string name = a. Name ;
std::transform (name. begin (), name. end (), name. begin (), []( char c) { return std::tolower (c, std::locale ()); });
if (name. find (srchterm) != std::string::npos) {
filtereditems. push_back (a);
}
}
return filtereditems;
})-> onFrameChanged ([&]( const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Window& window) {
})-> onNewFrame ([&]( const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Window& window) {
})-> onMouseChanged ([&]( const SL::Screen_Capture::Image* img, const SL::Screen_Capture::MousePoint &mousepoint) {
})-> start_capturing ();
windowframgrabber-> SCL_SetFrameChangeInterval (std::chrono::milliseconds( 100 )); // 100 ms
windowframgrabber-> SCL_SetMouseChangeInterval (std::chrono::milliseconds( 100 )); // 100 ms
기음#
https://github.com/smasherprog/screen_capture_lite/blob/master/example_csharp/program.cs
//Setup Screen Capture for all monitors
var framgrabber = SL . Screen_Capture . CaptureConfiguration . CreateCaptureConfiguration ( ( ) =>
{
var mons = SL . Screen_Capture . SCL_GetMonitors ( ) ;
Console . WriteLine ( "Library is requesting the list of monitors to capture!" ) ;
for ( int i = 0 ; i < mons . Length ; ++ i )
{
WriteLine ( mons [ i ] ) ;
}
return mons ;
} ) . onNewFrame ( ( SL . Screen_Capture . Image img , SL . Screen_Capture . Monitor monitor ) =>
{
} ) . onFrameChanged ( ( SL . Screen_Capture . Image img , SL . Screen_Capture . Monitor monitor ) =>
{
} ) . onMouseChanged ( ( SL . Screen_Capture . Image img , SL . Screen_Capture . MousePoint mousePoint ) =>
{
} ) . start_capturing ( ) ;
framgrabber . SCL_SetFrameChangeInterval ( 100 ) ;
framgrabber . SCL_SetMouseChangeInterval ( 100 ) ;
//Setup Screen Capture for windows that have the title "google" in it
var framgrabber = SL . Screen_Capture . CaptureConfiguration . CreateCaptureConfiguration ( ( ) =>
{
var windows = SL . Screen_Capture . SCL_GetWindows ( ) ;
Console . WriteLine ( "Library is requesting the list of windows to capture!" ) ;
for ( int i = 0 ; i < windows . Length ; ++ i )
{
WriteLine ( windows [ i ] ) ;
}
return windows . Where ( a => a . Name . ToLower ( ) . Contains ( "google" ) ) . ToArray ( ) ;
} ) . onNewFrame ( ( SL . Screen_Capture . Image img , SL . Screen_Capture . Window monitor ) =>
{
} ) . onFrameChanged ( ( SL . Screen_Capture . Image img , SL . Screen_Capture . Window monitor ) =>
{
} ) . onMouseChanged ( ( SL . Screen_Capture . Image img , SL . Screen_Capture . MousePoint mousePoint ) =>
{
} ) . start_capturing ( ) ;
framgrabber . SCL_SetFrameChangeInterval ( 100 ) ;
framgrabber . SCL_SetMouseChangeInterval ( 100 ) ;관심있는 것을 정의하십시오. 해당 정보를 원하지 않는 경우 OnMouseChanged의 콜백을 정의하지 마십시오. 그렇게한다면, 라이브러리는 마우스 정보를 원하고 모니터를 모니터링한다고 가정합니다.
다시 말하지만, 신경 쓰지 않는 이벤트에 대해 콜백을 정의하지 마십시오. 그렇다면 도서관은 정보를 원한다고 가정 할 때 추가 작업을 수행합니다.
라이브러리는 모든 이미지 데이터를 소유하고 있으므로 콜백이 완료된 후 자신의 목적으로 사용하려면 데이터를 복사해야합니다!
각 모니터 또는 창은 자체 스레드에서 실행되므로 차단 또는 내부 동기화가 없습니다. 3 개의 모니터를 캡처하는 경우 스레드가 각 모니터를 캡처합니다.
start_capturing이 호출 된 후에 icaptureconfiguration에 대한 호출을 변경할 수 없습니다. 당신은 그것을 파괴하고 그것을 재현해야합니다!
모든 통화가 스레드 안전하므로 iscreencapturemanager에 대한 통화는 언제든지 스레드에서 언제든지 변경할 수 있습니다!