当前位置:网站首页>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

边栏推荐
- Transplant tinyplay for imx6q development board QT system
- An overview of 2D human posture estimation
- R language uses dplyr package group_ The by function and the summarize function calculate the mean and standard deviation of the target variables based on the grouped variables
- MySQL stored procedure exercise
- 基于51单片机的超声波测距仪
- ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
- redis 日常笔记
- flink sql-client.sh 使用教程
- Popular framework: the use of glide
- Opencv learning notes - linear filtering: box filtering, mean filtering, Gaussian filtering
猜你喜欢

软件测试之测试评估
![leetcode:6109. Number of people who know the secret [definition of DP]](/img/95/03e2606b249f26db052cf5075041c1.png)
leetcode:6109. Number of people who know the secret [definition of DP]

Node mongodb installation

Classify boost libraries by function

程序员自曝接私活:10个月时间接了30多个单子,纯收入40万

Test evaluation of software testing

No servers available for service: xxxx

WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能

A keepalived high availability accident made me learn it again

LVGL 8.2 Line wrap, recoloring and scrolling
随机推荐
ML:SHAP值的简介、原理、使用方法、经典案例之详细攻略
MySQL triggers
Nowcoder reverse linked list
Leetcode T49: 字母异位词分组
SqlServer函数,存储过程的创建和使用
流行框架:Glide的使用
Leetcode 61: rotating linked list
ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
关于miui12.5 红米k20pro用au或者povo2出现问题的解决办法
remount of the / superblock failed: Permission denied
Oppo find N2 product form first exposure: supplement all short boards
Ml: introduction, principle, use method and detailed introduction of classic cases of snap value
STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于GPIO)
Redis daily notes
RK1126平台OSD的实现支持颜色半透明度多通道支持中文
Detailed index of MySQL
[algorithm leetcode] interview question 04.03 Specific depth node linked list (Multilingual Implementation)
Data center concept
C language programming
Map of mL: Based on Boston house price regression prediction data set, an interpretable case of xgboost model using map value