当前位置:网站首页>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);
- 运行效果

边栏推荐
猜你喜欢

按照功能对Boost库进行分类

flink sql-client. SH tutorial

迅为IMX6Q开发板QT系统移植tinyplay

Real time data warehouse

Query optimizer for SQL optimization

codeforce:C. Sum of Substrings【边界处理 + 贡献思维 + 灵光一现】

Oppo find N2 product form first exposure: supplement all short boards

Why should Base64 encoding be used for image transmission

Detailed explanation of visual studio debugging methods

C# wpf 实现截屏框实时截屏功能
随机推荐
迅为IMX6Q开发板QT系统移植tinyplay
R language uses bwplot function in lattice package to visualize box plot and par Settings parameter custom theme mode
2022 game going to sea practical release strategy
LifeCycle
R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, and uses the by parameter to specify the groupin
第十六章 字符串本地化和消息字典(二)
潘多拉 IOT 开发板学习(RT-Thread)—— 实验3 按键实验(学习笔记)
Fs4059c is a 5V input boost charging 12.6v1.2a. Inputting a small current to three lithium battery charging chips will not pull it dead. The temperature is 60 ° and 1000-1100ma is recommended
富文本编辑:wangEditor使用教程
递增的三元子序列[贪心训练]
为什么图片传输要使用base64编码
Scratch Castle Adventure Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
leetcode:6109. 知道秘密的人数【dp的定义】
一文概览2D人体姿态估计
Some problems and ideas of data embedding point
Vscode common plug-ins summary
scratch古堡历险记 电子学会图形化编程scratch等级考试三级真题和答案解析2022年6月
leetcode:6109. Number of people who know the secret [definition of DP]
去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]
【云原生】我怎么会和这个数据库杠上了?