当前位置:网站首页>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);
- 运行效果
边栏推荐
- R language uses the mutation function of dplyr package to standardize the specified data column (using mean function and SD function), and calculates the grouping mean of the standardized target varia
- leetcode:6110. 网格图中递增路径的数目【dfs + cache】
- NowCoder 反转链表
- 商业智能BI财务分析,狭义的财务分析和广义的财务分析有何不同?
- MySQL之详解索引
- ML:SHAP值的简介、原理、使用方法、经典案例之详细攻略
- 关于miui12.5 红米k20pro用au或者povo2出现问题的解决办法
- codeforce:C. Sum of Substrings【边界处理 + 贡献思维 + 灵光一现】
- 第十七章 进程内存
- Leetcode T47: 全排列II
猜你喜欢
Digi restarts XBee Pro S2C production. Some differences need to be noted
Transplant tinyplay for imx6q development board QT system
实战解惑 | OpenCV中如何提取不规则ROI区域
【MySQL从入门到精通】【高级篇】(五)MySQL的SQL语句执行流程
基于51单片机的超声波测距仪
flink sql-client.sh 使用教程
按照功能对Boost库进行分类
No servers available for service: xxxx
Test process arrangement (3)
[MySQL from introduction to proficiency] [advanced chapter] (V) SQL statement execution process of MySQL
随机推荐
R语言dplyr包summarise_if函数计算dataframe数据中所有数值数据列的均值和中位数、基于条件进行数据汇总分析(Summarize all Numeric Variables)
Nowcoder reverse linked list
Compile oglpg-9th-edition source code with clion
Leetcode T49: 字母异位词分组
vscode 常用插件汇总
What is the difference between Bi financial analysis in a narrow sense and financial analysis in a broad sense?
Ml: introduction, principle, use method and detailed introduction of classic cases of snap value
Nowcoder rearrange linked list
关于miui12.5 红米k20pro用au或者povo2出现问题的解决办法
MySQL的触发器
Some problems and ideas of data embedding point
去除重複字母[貪心+單調棧(用數組+len來維持單調序列)]
商业智能BI财务分析,狭义的财务分析和广义的财务分析有何不同?
[cloud native] how can I compete with this database?
Popular framework: the use of glide
Leetcode 61: 旋转链表
Digi restarts XBee Pro S2C production. Some differences need to be noted
10.(地图数据篇)离线地形数据处理(供Cesium使用)
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
Test process arrangement (2)