当前位置:网站首页>LVGL 8.2 text shadow
LVGL 8.2 text shadow
2022-07-04 14:35:00 【Fairy sword love】
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);
}
Running effect
- Modify shadow transparency from LV_OPA_30 Change to LV_OPA_60
lv_style_set_text_opa(&style_shadow, LV_OPA_60);
- Running effect
- Modify shadow alignment coordinates
lv_obj_align_to(shadow_label, main_label, LV_ALIGN_TOP_LEFT, 4, 4);
- Running effect
边栏推荐
- ML:SHAP值的简介、原理、使用方法、经典案例之详细攻略
- Query optimizer for SQL optimization
- GCC [6] - 4 stages of compilation
- MySQL的存储过程练习题
- Data center concept
- Pandora IOT development board learning (RT thread) - Experiment 3 button experiment (learning notes)
- Ruiji takeout notes
- Classify boost libraries by function
- Chapter 16 string localization and message Dictionary (2)
- Leetcode T47: 全排列II
猜你喜欢
(1) The standard of performance tuning and the correct posture for tuning - if you have performance problems, go to the heapdump performance community!
Opencv learning notes - linear filtering: box filtering, mean filtering, Gaussian filtering
codeforce:C. Sum of Substrings【边界处理 + 贡献思维 + 灵光一现】
Classify boost libraries by function
失败率高达80%,企业数字化转型路上有哪些挑战?
Chapter 17 process memory
LVGL 8.2 text shadow
开发中常见问题总结
SqlServer函数,存储过程的创建和使用
Data Lake (13): spark and iceberg integrate DDL operations
随机推荐
架构方面的进步
R language ggplot2 visualization: gganimate package creates animated graph (GIF) and uses anim_ The save function saves the GIF visual animation
[cloud native] how can I compete with this database?
[information retrieval] link analysis
产业互联网则具备更大的发展潜能,具备更多的行业场景
Count the running time of PHP program and set the maximum running time of PHP
LVGL 8.2 Line
flink sql-client.sh 使用教程
Excel quickly merges multiple rows of data
Use of arouter
Leetcode T48: rotating images
Chapter 16 string localization and message Dictionary (2)
《opencv学习笔记》-- 线性滤波:方框滤波、均值滤波、高斯滤波
数据湖(十三):Spark与Iceberg整合DDL操作
深度学习7 Transformer系列实例分割Mask2Former
潘多拉 IOT 开发板学习(RT-Thread)—— 实验3 按键实验(学习笔记)
AI与生命科学
Digi XBee 3 rf: 4 protocols, 3 packages, 10 major functions
Compile oglpg-9th-edition source code with clion
Real time data warehouse