///=================================================================
///@brief Init_SD()
///=================================================================
void Init_SD()
{
if (!SD.begin(SD_CS))
{
Serial.println("SD Card Init : Error");
return;
}
else
Serial.println("SD Card Init : Success");
load_image_from_sd("/icon50/storm-night.jpg", 20,40, 50, 50);
load_image_from_sd("/icon50/Storm.jpg", 20,100, 50, 50);
load_image_from_sd("/gif/Eintracht.gif", 50,20, 100, 100);
lv_example_png_1("/PNG/wink.png", 100, 100);
lv_example_png_1("/PNG/Test.png", 10, 100);
lv_example_gif_1("/gif/Love.gif", 200, 10);
lv_example_gif_1("/gif/Eintracht.gif", 200, 110);
}
void lv_example_png_1(const char filename[],const int x, const int y )
{
LV_IMG_DECLARE(img_wink_png);
lv_obj_t * img;
/*
img = lv_img_create(lv_scr_act());
lv_img_set_src(img, &img_wink_png);
lv_obj_align(img, LV_ALIGN_TOP_LEFT, 20, 10);
*/
img = lv_img_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
if (SD.exists(filename))
Serial.printf("File : %s Success\n", filename);
else
Serial.printf("File : %s Error\n", filename);
lv_img_set_src(img, filename);
lv_obj_align(img, LV_ALIGN_TOP_LEFT, x, y);
}
void lv_example_gif_1(const char filename[],const int x, const int y )
{
LV_IMG_DECLARE(img_bulb_gif);
lv_obj_t * img;
/*
img = lv_gif_create(lv_scr_act());
lv_gif_set_src(img, &img_bulb_gif);
lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0);
*/
img = lv_gif_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
if (SD.exists(filename))
Serial.printf("File : %s Success\n", filename);
else
Serial.printf("File : %s Error\n", filename);
lv_gif_set_src(img, filename);
lv_obj_align(img, LV_ALIGN_TOP_LEFT, x, y);
}
In this Code the JPG are working well because I removed Progressiv and Baseline with Gimp but No Success with Loading the PNG and GIF from LVGL Example. What I’m doing wrong ?