当前位置:网站首页>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 )
边栏推荐
- Huiyuan, 30, is going to have a new owner
- Jmeter性能测试:ServerAgent资源监控
- Machine learning notes - gray wolf optimization
- The difference between abstract classes and interfaces in PHP (PHP interview theory question)
- What are CSRF, XSS, SQL injection, DDoS attack and timing attack respectively and how to prevent them (PHP interview theory question)
- Number protection AXB function! (essence)
- DVWA range clearance tutorial
- Magic methods and usage in PHP (PHP interview theory questions)
- I include of spring and Autumn
- JMeter performance test: serveragent resource monitoring
猜你喜欢
超越PaLM!北大碩士提出DiVeRSe,全面刷新NLP推理排行榜
爱可可AI前沿推介(7.5)
Common redis data types and application scenarios
Common PHP interview questions (1) (written PHP interview questions)
1330: [example 8.3] minimum steps
P6183 [USACO10MAR] The Rock Game S
美团优选管理层变动:老将刘薇调岗,前阿里高管加盟
Photoshop plug-in action related concepts actionlist actiondescriptor actionlist action execution load call delete PS plug-in development
Mongdb learning notes
Select sort and bubble sort
随机推荐
Magic methods and usage in PHP (PHP interview theory questions)
[recruitment position] infrastructure software developer
我想咨询一下,mysql一个事务对于多张表的更新,怎么保证数据一致性的?
Aike AI frontier promotion (7.5)
[12 classic written questions of array and advanced pointer] these questions meet all your illusions about array and pointer, come on!
Optional parameters in the for loop
Misc Basic test method and knowledge points of CTF
episodic和batch的定义
The elimination strategy of redis
ionic cordova项目修改插件
Ionic Cordova project modification plug-in
Garbage collection mechanism of PHP (theoretical questions of PHP interview)
Mysql---- function
超越PaLM!北大硕士提出DiVeRSe,全面刷新NLP推理排行榜
Ctfshow web entry information collection
P6183 [USACO10MAR] The Rock Game S
Brief introduction of machine learning framework
JMeter performance test: serveragent resource monitoring
qt creater断点调试程序详解
想问下大家伙,有无是从腾讯云MYSQL同步到其他地方的呀?腾讯云MySQL存到COS上的binlog