main: implement saveScreenshot() writing bmp/png from SDL window buffer

When pressing `i` create a screenshot of the current InfiniTime screen
by dumping it to a timestamped png or bmp file like
`InfiniSim_2022-03-08_203421.png`.

Add a new configure option `WITH_PNG` with default `ON`. When switched
to `OFF` the screenshots will be created in `bmp` format.

Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/5
This commit is contained in:
Reinhold Gschweicher
2022-03-02 22:05:28 +01:00
parent 819d9cbdcb
commit dfbc345511
5 changed files with 115 additions and 0 deletions

View File

@@ -97,6 +97,7 @@ Using the keyboard the following events can be triggered:
- `S` ... decrease step count by 500 steps
- `h` ... set heartrate running, and on further presses increase by 10 bpm
- `H` ... stop heartrate
- `i` ... take screenshot
## Licenses