-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not working correct yet, the coords for capturing are not correct.
- Loading branch information
1 parent
516a8c9
commit 3703390
Showing
17 changed files
with
1,462 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"variant": { | ||
"label": "Release", | ||
"label": "Debug", | ||
"keywordSettings": { | ||
"buildType": "release" | ||
"buildType": "debug" | ||
}, | ||
"description": "Enable optimizations, omit debug info" | ||
"description": "Emit debug information without performing optimizations" | ||
}, | ||
"activeEnvironments": [ | ||
"Visual C++ 14.0 - amd64" | ||
"Visual C++ 14.0 - x86" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"C_Cpp.clang_format_style": "WebKit" | ||
"C_Cpp.clang_format_style": "WebKit", | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
project(Screen_Capture_Example) | ||
|
||
include_directories(${Screen_Capture_SOURCE_DIR}/include) | ||
add_executable(${PROJECT_NAME} Screen_Capture_Example.cpp) | ||
|
||
|
||
add_executable(${PROJECT_NAME} tiny_jpeg.h Screen_Capture_Example.cpp) | ||
target_link_libraries(${PROJECT_NAME} Screen_Capturelib) | ||
|
||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
#include "windows\ScreenCaptureDX.h" | ||
#include <iostream> | ||
#include <chrono> | ||
#include <atomic> | ||
|
||
#include <string> | ||
#define TJE_IMPLEMENTATION | ||
#include "tiny_jpeg.h" | ||
|
||
int main() | ||
{ | ||
|
||
std::atomic<int> realcounter; | ||
realcounter = 0; | ||
SL::Screen_Capture::ScreenCaptureDX dx; | ||
SL::Screen_Capture::ImageCallback func = [](const SL::Screen_Capture::Image& img, SL::Screen_Capture::Captured_Image type) { | ||
//std::cout << "Got here" << std::endl; | ||
SL::Screen_Capture::ImageCallback func = [&](const SL::Screen_Capture::CapturedImage& img) { | ||
if (img.ScreenIndex != 1) return; | ||
std::cout << "Height " << img.Height << ", Width " << img.Width << ", Top " << img.AbsoluteTop << ", Left " << img.AbsoluteLeft << std::endl; | ||
auto r = realcounter.fetch_add(1); | ||
std::string s("screen"); | ||
s += std::to_string(img.AbsoluteTop) + std::string(",") + std::to_string(img.AbsoluteLeft) +std::string(" ") + std::to_string(r) + std::string(".jpg"); | ||
//savetodisk(img, s); | ||
|
||
if (!tje_encode_to_file(s.c_str(), img.Width, img.Height, 4, (const unsigned char*)img.Data.get())) { | ||
std::cout << "Could not write JPEG\n"; | ||
} | ||
}; | ||
dx.StartProcessing(func); | ||
while (true) { | ||
|
||
|
||
|
||
std::this_thread::sleep_for(std::chrono::milliseconds(50)); | ||
|
||
while (true) { | ||
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); | ||
} | ||
|
||
dx.StopProcessing(); | ||
int k = 0; | ||
std::cin >> k; | ||
return 0; | ||
} | ||
} | ||
|
Oops, something went wrong.