当前位置:网站首页>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
- PyTorch的自动求导机制详细解析,PyTorch的核心魔法
- sql优化之查询优化器
- Leetcode t47: full arrangement II
- R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, and uses the by parameter to specify the groupin
- Digi重启XBee-Pro S2C生产,有些差别需要注意
- Redis daily notes
- Ruiji takeout notes
- Matters needing attention in overseas game Investment Agency
- SqlServer函数,存储过程的创建和使用
猜你喜欢
Visual Studio调试方式详解
WT588F02B-8S(C006_03)单芯片语音ic方案为智能门铃设计降本增效赋能
去除重复字母[贪心+单调栈(用数组+len来维持单调序列)]
SqlServer函数,存储过程的创建和使用
STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于GPIO)
数据湖(十三):Spark与Iceberg整合DDL操作
C # WPF realizes the real-time screen capture function of screen capture box
Stm32f1 and stm32subeide programming example -max7219 drives 8-bit 7-segment nixie tube (based on GPIO)
Nowcoder reverse linked list
RK1126平台OSD的实现支持颜色半透明度多通道支持中文
随机推荐
ML之shap:基于boston波士顿房价回归预测数据集利用shap值对XGBoost模型实现可解释性案例
数据中台概念
海外游戏代投需要注意的
卷积神经网络经典论文集合(深度学习分类篇)
gin集成支付宝支付
【云原生】我怎么会和这个数据库杠上了?
Use of tiledlayout function in MATLAB
统计php程序运行时间及设置PHP最长运行时间
为什么图片传输要使用base64编码
Data warehouse interview question preparation
Leetcode t47: full arrangement II
docker-compose公网部署redis哨兵模式
R language uses bwplot function in lattice package to visualize box plot and par Settings parameter custom theme mode
AI与生命科学
An overview of 2D human posture estimation
Ws2818m is packaged in cpc8. It is a special circuit for three channel LED drive control. External IC full-color double signal 5v32 lamp programmable LED lamp with outdoor engineering
ViewModel 初体验
产业互联网则具备更大的发展潜能,具备更多的行业场景
MySQL之详解索引
【MySQL从入门到精通】【高级篇】(四)MySQL权限管理与控制