Support for viewing BMP files in File Manager and setting as Splash screen (#1242)

* Use filesystem::path type vs string for BMP file name

* Use filesystem::path type vs string for BMP files

* Use a global const file path string for "/splash.bmp"

* Support for viewing BMP files and setting as Splash screen

* Support for viewing BMP files and setting as Splash screen

* Support for viewing BMP files and setting as Splash screen

* Update ui_ss_viewer.cpp

* Update ui_ss_viewer.hpp
This commit is contained in:
Mark Thompson
2023-07-05 15:45:43 -05:00
committed by GitHub
parent 8530fa8194
commit fcb681f4ae
6 changed files with 67 additions and 11 deletions

View File

@@ -412,7 +412,7 @@ void ILI9341::drawBMP(const ui::Point p, const uint8_t* bitmap, const bool trans
24bpp RGB
32bpp ARGB
*/
bool ILI9341::drawBMP2(const ui::Point p, const std::string file) {
bool ILI9341::drawBMP2(const ui::Point p, const std::filesystem::path& file) {
File bmpimage;
size_t file_pos = 0;
uint16_t pointer = 0;

View File

@@ -25,6 +25,7 @@
#include "ui.hpp"
#include "ui_text.hpp"
#include "file.hpp"
#include <cstdint>
#include <array>
@@ -58,7 +59,7 @@ class ILI9341 {
void draw_pixel(const ui::Point p, const ui::Color color);
void drawBMP(const ui::Point p, const uint8_t* bitmap, const bool transparency);
bool drawBMP2(const ui::Point p, const std::string file);
bool drawBMP2(const ui::Point p, const std::filesystem::path& file);
void render_line(const ui::Point p, const uint8_t count, const ui::Color* line_buffer);
void render_box(const ui::Point p, const ui::Size s, const ui::Color* line_buffer);