Compare commits
2 Commits
736f27a6b8
...
6dc1196646
Author | SHA1 | Date | |
---|---|---|---|
6dc1196646 | |||
557096abef |
@@ -90,6 +90,10 @@ void FractalInspectorApp::ParseCmdLineMessage(const std::string &message) {
|
||||
|
||||
}
|
||||
|
||||
if (misc::string_matches(cmd, {"screenshot", "screeny", "capture"})) {
|
||||
return TakeScreenshot();
|
||||
}
|
||||
|
||||
console->Log(std::format("No such command: {}", cmd), Colors::Red);
|
||||
}
|
||||
|
||||
@@ -680,7 +684,13 @@ void FractalInspectorApp::TakeScreenshot() {
|
||||
}
|
||||
uint8_t* frameBuffer = reinterpret_cast<uint8_t*>(pdatac3.data());
|
||||
|
||||
std::ofstream file("screenshot.bmp", std::ios::out | std::ios::binary);
|
||||
time_t t = std::time(nullptr);
|
||||
tm tm = *std::localtime(&t);
|
||||
|
||||
std::ostringstream filename;
|
||||
filename << std::put_time(&tm, "%Y-%m-%d %H-%M-%S") << ".bmp";
|
||||
|
||||
std::ofstream file(filename.str(), std::ios::out | std::ios::binary);
|
||||
|
||||
Vector2i wh = this->canvas->GetDimensions();
|
||||
|
||||
@@ -719,4 +729,6 @@ void FractalInspectorApp::TakeScreenshot() {
|
||||
|
||||
file.close();
|
||||
|
||||
console->Log(std::format("Took screenshot: {}", filename.str()));
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user