mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-20 03:37:43 +00:00
Capture screen image, save to PNG file on SD card.
This commit is contained in:
@@ -180,6 +180,7 @@ CPPSRC = main.cpp \
|
|||||||
sd_card.cpp \
|
sd_card.cpp \
|
||||||
file.cpp \
|
file.cpp \
|
||||||
log_file.cpp \
|
log_file.cpp \
|
||||||
|
png_writer.cpp \
|
||||||
manchester.cpp \
|
manchester.cpp \
|
||||||
string_format.cpp \
|
string_format.cpp \
|
||||||
temperature_logger.cpp \
|
temperature_logger.cpp \
|
||||||
|
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include "core_control.hpp"
|
#include "core_control.hpp"
|
||||||
|
|
||||||
|
#include "png_writer.hpp"
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
/* SystemStatusView ******************************************************/
|
/* SystemStatusView ******************************************************/
|
||||||
@@ -77,6 +79,13 @@ void SystemStatusView::set_title(const std::string new_value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SystemStatusView::on_camera() {
|
void SystemStatusView::on_camera() {
|
||||||
|
PNGWriter png { "capture.png" };
|
||||||
|
|
||||||
|
for(int i=0; i<320; i++) {
|
||||||
|
std::array<ColorRGB888, 240> row;
|
||||||
|
portapack::display.read_pixels({ 0, i, 240, 1 }, row);
|
||||||
|
png.write_scanline(row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Navigation ************************************************************/
|
/* Navigation ************************************************************/
|
||||||
|
Reference in New Issue
Block a user