当前位置:网站首页>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 )
边栏推荐
- Can I pass the PMP Exam in 20 days?
- Object. defineProperty() - VS - new Proxy()
- CPU design practice - Chapter 4 practical task 2 using blocking technology to solve conflicts caused by related problems
- sql server char nchar varchar和nvarchar的区别
- JMeter performance test: serveragent resource monitoring
- 把 ”中台“ 的思想迁移到代码中去
- 华为哈勃化身硬科技IPO收割机
- OSI 七层模型
- I want to inquire about how to ensure data consistency when a MySQL transaction updates multiple tables?
- Bugku's Eval
猜你喜欢
把 ”中台“ 的思想迁移到代码中去
你童年的快乐,都是被它承包了
How can I quickly check whether there is an error after FreeSurfer runs Recon all—— Core command tail redirection
Common redis data types and application scenarios
P6183 [USACO10MAR] The Rock Game S
Mysql---- function
Ctfshow web entry explosion
Object. defineProperty() - VS - new Proxy()
Bugku telnet
Selection and use of bceloss, crossentropyloss, sigmoid, etc. in pytorch classification
随机推荐
lv_font_conv离线转换
Huawei Hubble incarnation hard technology IPO harvester
漫画:程序员不是修电脑的!
Jmeter性能测试:ServerAgent资源监控
Easyocr character recognition
30岁汇源,要换新主人了
社区团购撤城“后遗症”
ionic cordova项目修改插件
[recruitment position] infrastructure software developer
当代人的水焦虑:好水究竟在哪里?
美团优选管理层变动:老将刘薇调岗,前阿里高管加盟
Stm32+bh1750 photosensitive sensor obtains light intensity
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
Magic methods and usage in PHP (PHP interview theory questions)
JS topic - console log()
NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
Talk about your understanding of microservices (PHP interview theory question)
The difference between abstract classes and interfaces in PHP (PHP interview theory question)
Huiyuan, 30, is going to have a new owner
Fr exercise topic - simple question