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

边栏推荐
猜你喜欢

Digi restarts XBee Pro S2C production. Some differences need to be noted

Use of tiledlayout function in MATLAB

docker-compose公网部署redis哨兵模式

Map of mL: Based on Boston house price regression prediction data set, an interpretable case of xgboost model using map value

C # WPF realizes the real-time screen capture function of screen capture box

What is the difference between Bi financial analysis in a narrow sense and financial analysis in a broad sense?

潘多拉 IOT 开发板学习(RT-Thread)—— 实验3 按键实验(学习笔记)

Compile oglpg-9th-edition source code with clion

Ruiji takeout notes
![去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]](/img/af/a1dcba6f45eb4ccc668cd04a662e9c.png)
去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]
随机推荐
2022 game going to sea practical release strategy
Leetcode T49: 字母异位词分组
leetcode:6109. 知道秘密的人数【dp的定义】
海外游戏代投需要注意的
数据中台概念
Sqlserver functions, creation and use of stored procedures
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
DDD application and practice of domestic hotel transactions -- Code
Chapter 17 process memory
一种架构来完成所有任务—Transformer架构正在以一己之力统一AI江湖
10.(地图数据篇)离线地形数据处理(供Cesium使用)
R语言ggplot2可视化:gganimate包创建动态折线图动画(gif)、使用transition_reveal函数在动画中沿给定维度逐步显示数据
GCC【6】- 编译的4个阶段
C # WPF realizes the real-time screen capture function of screen capture box
电商系统中红包活动设计
WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能
Intelligence d'affaires bi analyse financière, analyse financière au sens étroit et analyse financière au sens large sont - ils différents?
Solutions to the problems of miui12.5 red rice k20pro using Au or povo2
flink sql-client.sh 使用教程
数据湖(十三):Spark与Iceberg整合DDL操作