mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-16 13:42:16 -04:00
Capture screen image, save to PNG file on SD card.
This commit is contained in:
parent
925394c54b
commit
52016defd5
2 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,8 @@
|
|||
|
||||
#include "core_control.hpp"
|
||||
|
||||
#include "png_writer.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
/* SystemStatusView ******************************************************/
|
||||
|
@ -77,6 +79,13 @@ void SystemStatusView::set_title(const std::string new_value) {
|
|||
}
|
||||
|
||||
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 ************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue