当前位置:网站首页>LVGL 8.2 Line
LVGL 8.2 Line
2022-07-04 14:35:00 【Fairy sword love】
Simple Line
{
/*Create an array for the points of the line*/
static lv_point_t line_points[] = {
{
5, 5}, {
70, 70}, {
120, 10}, {
180, 60}, {
240,10} }; // 5 Coordinate values of points
/*Create style*/
static lv_style_t style_line;
lv_style_init(&style_line);
lv_style_set_line_width(&style_line, 8); // Set the line width
lv_style_set_line_color(&style_line, lv_palette_main(LV_PALETTE_BLUE));// Set the line color to blue
lv_style_set_line_rounded(&style_line, true); // Enable line fillet function
/*Create a line and apply the new style*/
lv_obj_t* line1;
line1 = lv_line_create(lv_scr_act()); // Create a line object
lv_line_set_points(line1, line_points, 5); // Set the number of line data points
lv_obj_add_style(line1, &style_line, 0); // Line addition style
lv_obj_center(line1); // centered
}
Running effect
- Change the line color to red
lv_style_set_line_color(&style_line, lv_palette_main(LV_PALETTE_RED));
- Running effect
- Turn off the fillet function
lv_style_set_line_rounded(&style_line, false);
- Change the line width to 1
lv_style_set_line_width(&style_line, 1);
- Running effect
边栏推荐
- Nowcoder rearrange linked list
- Digi restarts XBee Pro S2C production. Some differences need to be noted
- 架构方面的进步
- 【算法leetcode】面试题 04.03. 特定深度节点链表(多语言实现)
- ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
- 聊聊保证线程安全的 10 个小技巧
- 产业互联网则具备更大的发展潜能,具备更多的行业场景
- Pandora IOT development board learning (RT thread) - Experiment 3 button experiment (learning notes)
- 一种架构来完成所有任务—Transformer架构正在以一己之力统一AI江湖
- 曝光一下阿里的工资待遇和职位级别
猜你喜欢
失败率高达80%,企业数字化转型路上有哪些挑战?
Classify boost libraries by function
数据中台概念
Count the running time of PHP program and set the maximum running time of PHP
聊聊保证线程安全的 10 个小技巧
[information retrieval] experiment of classification and clustering
Visual Studio调试方式详解
NowCoder 反转链表
Node mongodb installation
Ultrasonic distance meter based on 51 single chip microcomputer
随机推荐
【C语言】指针笔试题
Chapter 17 process memory
Leetcode t49: grouping of alphabetic words
Leetcode T47: 全排列II
Xcode abnormal pictures cause IPA packet size problems
flink sql-client.sh 使用教程
软件测试之测试评估
leetcode:6110. 网格图中递增路径的数目【dfs + cache】
Use of arouter
NowCoder 反转链表
Opencv learning notes - linear filtering: box filtering, mean filtering, Gaussian filtering
[information retrieval] experiment of classification and clustering
R language uses follow up of epidisplay package The plot function visualizes the longitudinal follow-up map of multiple ID (case) monitoring indicators, and uses stress The col parameter specifies the
潘多拉 IOT 开发板学习(RT-Thread)—— 实验3 按键实验(学习笔记)
【信息检索】链接分析
LVGL 8.2 keyboard
MySQL的存储过程练习题
First experience of ViewModel
C language set operation
《opencv学习笔记》-- 线性滤波:方框滤波、均值滤波、高斯滤波