当前位置:网站首页>LVGL 8.2 Line
LVGL 8.2 Line
2022-07-04 13:07:00 【仙剑情缘】
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个点坐标值
/*Create style*/
static lv_style_t style_line;
lv_style_init(&style_line);
lv_style_set_line_width(&style_line, 8); // 设置线宽
lv_style_set_line_color(&style_line, lv_palette_main(LV_PALETTE_BLUE));//设置线条颜色为蓝色
lv_style_set_line_rounded(&style_line, true); // 使能线条圆角功能
/*Create a line and apply the new style*/
lv_obj_t* line1;
line1 = lv_line_create(lv_scr_act()); // 创建线条对象
lv_line_set_points(line1, line_points, 5); // 设置线条数据点数
lv_obj_add_style(line1, &style_line, 0); // 线条添加style
lv_obj_center(line1); // 居中显示
}
运行效果

- 修改线条颜色为红色
lv_style_set_line_color(&style_line, lv_palette_main(LV_PALETTE_RED));
- 运行效果

- 关闭圆角功能
lv_style_set_line_rounded(&style_line, false);

- 修改线宽为1
lv_style_set_line_width(&style_line, 1);
- 运行效果

边栏推荐
- Respect others' behavior
- [algorithm leetcode] interview question 04.03 Specific depth node linked list (Multilingual Implementation)
- Intelligence d'affaires bi analyse financière, analyse financière au sens étroit et analyse financière au sens large sont - ils différents?
- Data warehouse interview question preparation
- 【MySQL从入门到精通】【高级篇】(四)MySQL权限管理与控制
- Digi XBee 3 rf: 4 protocols, 3 packages, 10 major functions
- LifeCycle
- 聊聊保证线程安全的 10 个小技巧
- Transplant tinyplay for imx6q development board QT system
- Some problems and ideas of data embedding point
猜你喜欢

商業智能BI財務分析,狹義的財務分析和廣義的財務分析有何不同?

商业智能BI财务分析,狭义的财务分析和广义的财务分析有何不同?
![递增的三元子序列[贪心训练]](/img/92/7efd1883c21c0e804ffccfb2231602.png)
递增的三元子序列[贪心训练]

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

Intelligence d'affaires bi analyse financière, analyse financière au sens étroit et analyse financière au sens large sont - ils différents?

数据中台概念

Vscode common plug-ins summary

【信息检索】链接分析

10.(地图数据篇)离线地形数据处理(供Cesium使用)

Detailed explanation of visual studio debugging methods
随机推荐
Excel quickly merges multiple rows of data
Leetcode 61: rotating linked list
WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能
Leetcode T49: 字母异位词分组
Count the running time of PHP program and set the maximum running time of PHP
MySQL之详解索引
R language uses bwplot function in lattice package to visualize box plot and par Settings parameter custom theme mode
Ruiji takeout notes
LiveData
R语言使用dplyr包的group_by函数和summarise函数基于分组变量计算目标变量的均值、标准差
第十七章 进程内存
Incremental ternary subsequence [greedy training]
Real time data warehouse
Popular framework: the use of glide
Progress in architecture
数据中台概念
[cloud native] how can I compete with this database?
Leetcode 61: 旋转链表
Detailed explanation of visual studio debugging methods
Codeforce:c. sum of substrings