fix(color): Default splash screen that fits NV14/EL18 screens (#2764)

This commit is contained in:
richardclli
2023-04-14 19:46:21 +10:00
committed by GitHub
parent 4f624cc3bc
commit 01829a12d2
6 changed files with 31 additions and 5 deletions
+25 -3
View File
@@ -23,10 +23,22 @@
#if defined(SPLASH)
const uint8_t __bmp_splash[] {
#include "splash.lbm"
const uint8_t __bmp_splash_bg[] {
#include "splash_bg.lbm"
};
//const uint8_t __bmp_splash_bg2[] {
//#include "splash_bg2.lbm"
//};
const uint8_t __bmp_splash_logo[] {
#include "splash_logo.lbm"
};
//static const uint8_t mask_splash_bg[] = {
//#include "mask_splash_bg.lbm"
//};
void draw_splash_cb(lv_event_t * e)
{
auto draw_ctx = lv_event_get_draw_ctx(e);
@@ -63,7 +75,17 @@ void drawSplash()
loadSplashImg = false;
if (splashImg == nullptr) {
splashImg = new LZ4Bitmap(BMP_RGB565, __bmp_splash);
splashImg = new BitmapBuffer(BMP_RGB565, LCD_W, LCD_H);
BitmapBuffer* splashBg = new LZ4Bitmap(BMP_ARGB4444, __bmp_splash_bg);
BitmapBuffer* splashLogo = new LZ4Bitmap(BMP_ARGB4444, __bmp_splash_logo);
for (int i=0; i<LCD_W; i += splashBg->width()) {
for (int j=0; j<LCD_H; j += splashBg->height()) {
splashImg->drawBitmap(i, j, splashBg);
}
}
splashImg->drawBitmap((LCD_W/2) - (splashLogo->width()/2),
(LCD_H/2) - (splashLogo->height()/2),
splashLogo);
}
splashScreen = window_create(nullptr);