当前位置:网站首页>Example of lvgl display picture
Example of lvgl display picture
2022-07-05 15:24:00 【Neo Wordsworth】
adopt Online image conversion tool Get a picture file , The data extracted here is convenient for understanding the display of pictures ( This data can be transmitted over the network or Bluetooth )
uint8_t myimg_map[] = {
0x00, 0x00, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00,
0xfe, 0x7f,
0xfd, 0xbf,
0xc0, 0x03,
0xd7, 0xdb,
0xcf, 0xeb,
0xdf, 0xf3,
0x9e, 0x79,
0x5d, 0xba,
0x5d, 0xba,
0x9e, 0x79,
0xdf, 0xfb,
0xcf, 0xe3,
0xd7, 0xdb,
0xc0, 0x03,
0xfd, 0xbf,
0xfe, 0x7f,
};
void test1(){
static lv_img_dsc_t myimg;
myimg.header.cf = LV_IMG_CF_INDEXED_1BIT;
myimg.header.always_zero = 0;
myimg.header.reserved = 0;
myimg.header.w = 16;
myimg.header.h = 16;
myimg.data_size = 40;
myimg.data = myimg_map;
lv_obj_t * icon = lv_img_create(lv_scr_act());
lv_obj_center(icon);
lv_img_set_src(icon, &myimg);
//#define LV_MY_RECOLOR 1 // Note here, the original red
#if LV_MY_RECOLOR
static lv_style_t img_style;
lv_style_init(&img_style);
lv_style_set_img_recolor(&img_style,lv_color_hex(0x0000ff));
lv_style_set_img_recolor_opa(&img_style,255);
lv_obj_add_style(icon, &img_style, 0);
#endif
}
After running, such a small picture is displayed
If enable defines LV_MY_RECOLOR
You can recolor , Original red , Recolor to blue
(LV_IMG_CF_INDEXED_1BIT Before the data 3 Bits represent colors : blue 、 green 、 red )
边栏推荐
- Surpass palm! Peking University Master proposed diverse to comprehensively refresh the NLP reasoning ranking
- 百亿按摩仪蓝海,难出巨头
- Detailed explanation of QT creator breakpoint debugger
- Bugku's Eval
- Ten billion massage machine blue ocean, difficult to be a giant
- The difference between SQL Server char nchar varchar and nvarchar
- I want to inquire about how to ensure data consistency when a MySQL transaction updates multiple tables?
- 计算中间件 Apache Linkis参数解读
- Thymeleaf uses background custom tool classes to process text
- Au - delà du PARM! La maîtrise de l'Université de Pékin propose diverse pour actualiser complètement le classement du raisonnement du NLP
猜你喜欢
How can I quickly check whether there is an error after FreeSurfer runs Recon all—— Core command tail redirection
Common PHP interview questions (1) (written PHP interview questions)
Your childhood happiness was contracted by it
Ionic Cordova project modification plug-in
I include of spring and Autumn
Misc Basic test method and knowledge points of CTF
Bugku's Eval
Anti shake and throttling
CODING DevSecOps 助力金融企业跑出数字加速度
Bugku's eyes are not real
随机推荐
Aike AI frontier promotion (7.5)
swiper. JS to achieve barrage effect
Super wow fast row, you are worth learning!
想问下大家伙,有无是从腾讯云MYSQL同步到其他地方的呀?腾讯云MySQL存到COS上的binlog
Huiyuan, 30, is going to have a new owner
sql server学习笔记
Ctfshow web entry explosion
机器学习框架简述
P1451 calculate the number of cells / 1329: [example 8.2] cells
Magic methods and usage in PHP (PHP interview theory questions)
Leetcode: Shortest Word Distance II
SQL Server learning notes
qt creater断点调试程序详解
P6183 [USACO10MAR] The Rock Game S
Visual task scheduling & drag and drop | scalph data integration based on Apache seatunnel
P1451 求细胞数量/1329:【例8.2】细胞
把 ”中台“ 的思想迁移到代码中去
Behind the ultra clear image quality of NBA Live Broadcast: an in-depth interpretation of Alibaba cloud video cloud "narrowband HD 2.0" technology
[recruitment position] infrastructure software developer
美团优选管理层变动:老将刘薇调岗,前阿里高管加盟