当前位置:网站首页>LVGL 8.2 text shadow
LVGL 8.2 text shadow
2022-07-04 13:07:00 【仙剑情缘】
Create a fake text shadow
static void lv_example_label_2(void)
{
/*Create a style for the shadow*/
static lv_style_t style_shadow;
lv_style_init(&style_shadow);
lv_style_set_text_opa(&style_shadow, LV_OPA_30);
lv_style_set_text_color(&style_shadow, lv_color_black());
/*Create a label for the shadow first (it's in the background)*/
lv_obj_t* shadow_label = lv_label_create(lv_scr_act());
lv_obj_add_style(shadow_label, &style_shadow, 0);
/*Create the main label*/
lv_obj_t* main_label = lv_label_create(lv_scr_act());
lv_label_set_text(main_label, "A simple method to create\n"
"shadows on a text.\n"
"It even works with\n\n"
"newlines and spaces.");
/*Set the same text for the shadow label*/
lv_label_set_text(shadow_label, lv_label_get_text(main_label));
/*Position the main label*/
lv_obj_align(main_label, LV_ALIGN_CENTER, 0, 0);
/*Shift the second label down and to the right by 2 pixel*/
lv_obj_align_to(shadow_label, main_label, LV_ALIGN_TOP_LEFT, 2, 2);
}
运行效果
- 修改阴影透明度从LV_OPA_30改到LV_OPA_60
lv_style_set_text_opa(&style_shadow, LV_OPA_60);
- 运行效果
- 修改阴影对齐坐标
lv_obj_align_to(shadow_label, main_label, LV_ALIGN_TOP_LEFT, 4, 4);
- 运行效果
边栏推荐
- Redis daily notes
- Leetcode 61: 旋转链表
- Solutions aux problèmes d'utilisation de l'au ou du povo 2 dans le riz rouge k20pro MIUI 12.5
- SqlServer函数,存储过程的创建和使用
- Ws2818m is packaged in cpc8. It is a special circuit for three channel LED drive control. External IC full-color double signal 5v32 lamp programmable LED lamp with outdoor engineering
- Compile oglpg-9th-edition source code with clion
- Map of mL: Based on Boston house price regression prediction data set, an interpretable case is realized by using the map value to the LIR linear regression model
- Learn kernel 3: use GDB to track the kernel call chain
- Leetcode t47: full arrangement II
- docker-compose公网部署redis哨兵模式
猜你喜欢
SqlServer函数,存储过程的创建和使用
Leetcode 61: 旋转链表
leetcode:6110. The number of incremental paths in the grid graph [DFS + cache]
Learn kernel 3: use GDB to track the kernel call chain
Count the running time of PHP program and set the maximum running time of PHP
Excel quickly merges multiple rows of data
Leetcode T48: rotating images
Transplant tinyplay for imx6q development board QT system
Oppo find N2 product form first exposure: supplement all short boards
What is the difference between Bi financial analysis in a narrow sense and financial analysis in a broad sense?
随机推荐
Incremental ternary subsequence [greedy training]
ViewModel 初体验
Leetcode t47: full arrangement II
产业互联网则具备更大的发展潜能,具备更多的行业场景
Some problems and ideas of data embedding point
vscode 常用插件汇总
Scratch Castle Adventure Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
GCC【6】- 编译的4个阶段
2022 game going to sea practical release strategy
Leetcode T48: rotating images
Detailed explanation of visual studio debugging methods
One architecture to complete all tasks - transformer architecture is unifying the AI Jianghu on its own
海外游戏代投需要注意的
Vscode common plug-ins summary
Ultrasonic distance meter based on 51 single chip microcomputer
R language uses bwplot function in lattice package to visualize box plot and par Settings parameter custom theme mode
游戏出海,全球化运营
数据中台概念
Leetcode T49: 字母异位词分组
leetcode:6109. 知道秘密的人数【dp的定义】