当前位置:网站首页>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);
- 运行效果

边栏推荐
- PyTorch的自动求导机制详细解析,PyTorch的核心魔法
- Map of mL: Based on Boston house price regression prediction data set, an interpretable case is realized by using the map value to the LIR linear regression model
- 【云原生】我怎么会和这个数据库杠上了?
- flink sql-client.sh 使用教程
- GCC【6】- 编译的4个阶段
- C# wpf 实现截屏框实时截屏功能
- Test process arrangement (3)
- R language ggplot2 visualization: gganimate package creates animated graph (GIF) and uses anim_ The save function saves the GIF visual animation
- The failure rate is as high as 80%. What are the challenges on the way of enterprise digital transformation?
- Oppo find N2 product form first exposure: supplement all short boards
猜你喜欢

Data center concept

gin集成支付宝支付

Data Lake (13): spark and iceberg integrate DDL operations

Leetcode T48: rotating images

Detailed explanation of visual studio debugging methods

C # WPF realizes the real-time screen capture function of screen capture box

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

Scratch Castle Adventure Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022

Leetcode 61: 旋转链表

DDD application and practice of domestic hotel transactions -- Code
随机推荐
Chapter 16 string localization and message Dictionary (2)
ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
The game goes to sea and operates globally
Ruiji takeout notes
ARouter的使用
LifeCycle
flink sql-client.sh 使用教程
Data Lake (13): spark and iceberg integrate DDL operations
Vscode common plug-ins summary
NowCoder 反转链表
Leetcode T48: rotating images
Ml: introduction, principle, use method and detailed introduction of classic cases of snap value
10.(地图数据篇)离线地形数据处理(供Cesium使用)
(1)性能调优的标准和做好调优的正确姿势-有性能问题,上HeapDump性能社区!
Scratch Castle Adventure Electronic Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
Learn kernel 3: use GDB to track the kernel call chain
Leetcode t49: grouping of alphabetic words
Transplant tinyplay for imx6q development board QT system
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
R language ggplot2 visualization: gganimate package creates dynamic line graph animation (GIF) and uses transition_ The reveal function displays data step by step along a given dimension in the animat