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

3
.gitmodules vendored
View File

@@ -4,3 +4,6 @@
[submodule "lv_drivers"]
path = lv_drivers
url = ../../lvgl/lv_drivers.git
[submodule "libpng"]
path = libpng
url = git@github.com:glennrp/libpng.git