GUI
JDSH0224
这个作者很懒,什么都没留下…
展开
-
lvgl tabview(选项卡控件)
源代码:// Arc事件回调函数static void arc_event_handler(lv_obj_t *obj, lv_event_t event){ int angle = 0; // 改变的角度值 if (event == LV_EVENT_CLICKED) { // 控件上单击事件 LV_LOG_INFO("arc_event_handler->Arc Clicked\n"); } else if (event == LV_EVENT_VALUE_CHANGED原创 2021-01-25 23:35:51 · 4322 阅读 · 2 评论 -
lvgl sw(滑动按钮)
源代码:static void sw_event_handler(lv_obj_t * obj, lv_event_t event){ if (event == LV_EVENT_VALUE_CHANGED) { printf("State: %s\n", lv_sw_get_state(obj) ? "On" : "Off"); }} //24 滑动按钮控件 static lv_style_t bg_style; static lv_style_t indic_style;原创 2021-01-21 00:39:53 · 714 阅读 · 0 评论 -
lvgl spinbox(微调框控件)
源代码:static void spinbox_event_handler(lv_obj_t * obj, lv_event_t event){ if (event == LV_EVENT_VALUE_CHANGED) { printf("Value: %d\n", lv_spinbox_get_value(obj)); } else if (event == LV_EVENT_CLICKED) { /*For simple test: Click the spinbox to inc原创 2021-01-21 00:34:01 · 833 阅读 · 0 评论 -
lvgl slider(滑动条控件)
源代码:static lv_obj_t * slider_label;static void slider_event_cb(lv_obj_t * slider, lv_event_t event){ if (event == LV_EVENT_VALUE_CHANGED) { static char buf[4]; /* max 3 bytes for number plus 1 null terminating byte */ snprintf(buf, 4, "%u", lv_sl原创 2021-01-21 00:25:31 · 1985 阅读 · 1 评论 -
lvgl roller(滑动列表控件)
源代码:static void roller_event_handler(lv_obj_t * obj, lv_event_t event){ if (event == LV_EVENT_VALUE_CHANGED) { char buf[32]; lv_roller_get_selected_str(obj, buf, sizeof(buf)); printf("Selected month: %s\n", buf); }} //21 滚动对象 //21.1 创建一个滚动原创 2021-01-21 00:08:26 · 2740 阅读 · 2 评论 -
lvgl preload(预加载对象)
源代码: //20. 预加载对象 //20.1 对象属性设置 static lv_style_t style; lv_style_copy(&style, &lv_style_plain); style.line.width = 10; /*10 px thick arc*/ style.line.color = lv_color_hex3(0x258); /*Blueish arc color*/ style.原创 2021-01-20 23:50:54 · 847 阅读 · 0 评论 -
lvgl page(页表控件)
源代码 //19. 页表控件 //19.1 页表类型创建 static lv_style_t style_sb; lv_style_copy(&style_sb, &lv_style_plain); style_sb.body.main_color = LV_COLOR_BLACK; style_sb.body.grad_color = LV_COLOR_BLACK; style_sb.body.border.color = LV_COLOR_WHITE; style_s原创 2021-01-20 00:41:38 · 1555 阅读 · 1 评论 -
2021-01-20
源代码 //18. 消息弹窗控件 static const char * btns[] = { "Apply", "Close", "" }; mbox1 = lv_mbox_create(lv_scr_act(), NULL); lv_mbox_set_text(mbox1, "A message box with two buttons."); lv_mbox_add_btns(mbox1, btns); lv_obj_set_width(mbox1, 160); lv_obj_set原创 2021-01-20 00:25:50 · 120 阅读 · 0 评论 -
lvgl line meter(测线器对象)
源代码 //17.2 创建线表控件 /*Create a line meter */ lv_obj_t * lmeter; lmeter = lv_lmeter_create(lv_scr_act(), NULL); lv_lmeter_set_range(lmeter, 0, 100); /*Set the range*/ lv_lmeter_set_value(lmeter, 80); /*原创 2021-01-20 00:15:39 · 628 阅读 · 1 评论 -
lvgl list(列表控件)
源代码static void list_event_handler(lv_obj_t * obj, lv_event_t event){ if (event == LV_EVENT_CLICKED) { printf("Clicked: %s\n", lv_list_get_btn_text(obj)); }} //16. 列表控件 //16.1 创建列表控件 lv_obj_t * list1 = lv_list_create(lv_scr_act(), NULL); lv_o原创 2021-01-19 23:57:47 · 5173 阅读 · 2 评论 -
lvgl line
源代码 //15. 线控件 //15.1 设置线的点 static lv_point_t line_points[] = { { 0, 0 },{ 60, 0 },{ 60, 60 },{ 0, 60 },{ 0, 0 } }; //15.2 布局设置(线的颜色,宽度,圆角) static lv_style_t style_line; lv_style_copy(&style_line, &lv_style_plain); style_line.line.color =原创 2021-01-19 00:26:58 · 383 阅读 · 0 评论 -
lvgl LED
源代码: //14 LED控件 //14.1 创建标签 /*Create a style for the LED*/ static lv_style_t style_led; lv_style_copy(&style_led, &lv_style_pretty_color); style_led.body.radius = LV_RADIUS_CIRCLE; style_led.body.main_color = LV_COLOR_MAKE(0xb5, 0x0f, 0x04原创 2021-01-17 23:41:38 · 265 阅读 · 0 评论 -
lvgl label(标签)
源代码: //13. label标签控件 //13.1 创建标签 lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL); lv_label_set_long_mode(label1, LV_LABEL_LONG_BREAK); /*Break the long lines*/ lv_label_set_recolor(label1, true); /*Enable re-coloring原创 2021-01-17 23:39:05 · 1319 阅读 · 0 评论 -
lvgl 键盘控件(lv_kb)与文本区域控件(lv_ta)
源代码 /*Create styles for the keyboard*/ static lv_style_t rel_style, pr_style; lv_style_copy(&rel_style, &lv_style_btn_rel); rel_style.body.radius = 0; rel_style.body.border.width = 1; lv_style_copy(&pr_style, &lv_style_btn_pr); p原创 2021-01-17 00:24:41 · 1568 阅读 · 2 评论 -
lvgl imgbtn(图片按钮)
源码static lv_obj_t * imgbtn1;static lv_obj_t * imgbtn_label;static void imgbtn_event_handler(lv_obj_t * obj, lv_event_t event){ static int i = 0;; static char buffer[32]; if (obj == imgbtn1) { if (event == LV_EVENT_CLICKED) { i++; sprintf(原创 2021-01-15 00:16:32 · 5092 阅读 · 0 评论 -
lvgl image
//10. 图片控件 //10.1 创建一个控件对象 lv_obj_t * img1 = lv_img_create(lv_scr_act(), NULL); //10.2 设置显示的像素图片 lv_img_set_src(img1, &image_dog); //10.3 对齐 lv_obj_align(img1, NULL, LV_ALIGN_IN_LEFT_MID, 0, -120); lv_obj_t * img2 = lv_img_create(lv_scr_act()..原创 2021-01-14 00:23:45 · 1765 阅读 · 0 评论 -
lvgl gauge(表盘控件)
//9. 仪表控件 //设置时钟的网址:https://blog.csdn.net/mymycsdn321/article/details/108060627 //9.1 设置仪表的样式 static lv_style_t gauge_style; lv_style_copy(&gauge_style, &lv_style_pretty_color); gauge_style.body.main_color = lv_color_hex3(0x666); /*开始的刻度..原创 2021-01-13 00:46:50 · 2709 阅读 · 0 评论 -
lvgl lldist
//8. 下拉列表框对象 //8.1 创建一个下拉列表框对象 lv_obj_t * ddlist = lv_ddlist_create(lv_scr_act(), NULL); //8.2 设置下拉列表选项 lv_ddlist_set_options(ddlist, "Apple\n" "Banana\n" "Orange\n" "Melon\n" "Grape\n" "Raspberry"); //8.3 设置下拉列表的固定宽度 lv_ddlist_set_fix_wi..原创 2021-01-12 00:06:33 · 227 阅读 · 0 评论 -
lvgl cont(容器)
1. 容器控件1.1 创建一个容器对象1.2 当对象的大小基于上一次更改时,启用对象的自动重新对齐1.3 将一个对象的中点与另一个对象对齐1.4 同时在所有4个方向设置拟合策略1.5 在容器上设置布局1.6 休眠1000ms,然后在容器上添加一个标签演示代码 //7. 容器控件 //7.1 创建一个容器对象 lv_obj_t * cont = lv_cont_create(lv_scr_act(), NULL); //7.2 当对象的大小基于上一次更改时,启用对.原创 2021-01-10 00:30:32 · 1547 阅读 · 0 评论 -
lvgl chart
6.1 创建一个图表对象6.2 设置图表的大小6.3 设置图表的对齐位置6.4 设置图表的区域(LV_CHART_TYPE_AREA是线显示的区域,LV_CHART_TYPE_LINE表示单纯的线)6.5 设置图表的透明度6.6 设置数据系列的线宽或点半径(线的粗细)6.7 设置最大或最小的Y值6.8 设置每条数据线所具有的数据点个数,如果不设置的话,则默认值是 106.9 设置水平和垂直分割线6.10 设置 y 轴的数值范围,[0,100]也是默认值6.11 设置 y 轴的主刻度线长度原创 2021-01-08 00:48:47 · 4364 阅读 · 8 评论 -
lvgl cb(复选框)
1.创建复选框对象2.设置复选框文本3.设置复选框位置5.为复选框绑定事件 //5.复选框 //5.1 创建复选框对象 lv_obj_t * cb = lv_cb_create(lv_scr_act(), NULL); //5.2 设置复选框文本 lv_cb_set_text(cb, "I am the check box!"); //5.3 设置位置 lv_obj_align(cb, NULL, LV_ALIGN_CENTER, 0, 0); //5.4 绑定事件...原创 2021-01-06 23:55:16 · 505 阅读 · 0 评论 -
lvgl canvas
1.下载一张bmp图像图片链接2.调整图片的大小具体操作详见:图片尺寸、像素修改3.在线生成lvgl图片点阵信息链接:lvgl图片在线生成.c文件4.将生成的图片image_dog.c文件放到lvgl工程中5.配置画布的大小,及显示的图片LV_IMG_DECLARE(image_dog);#define CANVAS_WIDTH 210#define CANVAS_HEIGHT 1606.设置画布的缓冲区7.配置画布的样式8.设置画...原创 2021-01-06 00:20:14 · 1957 阅读 · 0 评论 -
lvgl btnm(矩阵按钮)
1.创建一个矩阵按钮映射表2.创建一个矩阵按钮对象3.使矩阵按钮映射表与矩阵按钮对象关联4.设置矩阵按钮的某个按钮宽度 //3. 创建一个矩阵按钮 //3.1 定义一个矩阵按钮 static const char * btnm_map[] = { "1", "2", "3", "+", "\n", "4", "5", "6", "-", "\n", "7", "8", "9", "*","\n", "0", "Ok",...原创 2021-01-04 23:53:55 · 1216 阅读 · 0 评论 -
lvgl bar
1.创建bar对象 //1 创建bar对象 lv_obj_t * bar = lv_bar_create(lv_scr_act(), NULL); //2 设置当前bar外观大小尺寸 lv_obj_set_size(bar, 200, 30); //3 设置其在父类中为中心对齐 lv_obj_align(bar, NULL, LV_ALIGN_IN_TOP_RIGHT, -80, 0); //4 设置其为1s变化一次 //lv_bar_set_anim_time(bar, 100.原创 2021-01-04 00:07:40 · 703 阅读 · 0 评论 -
lvgl arc
目录1.1 创建一个弧对象1.2 设置弧的空间配置(颜色)1.3arc事件1.4效果图a、初始状态b、变化状态1.1 创建一个弧对象 //1.1 创建一个弧对象 lv_obj_t *arc = lv_arc_create(lv_scr_act(), NULL); lv_arc_set_angles(arc, 0, 270); //设置Arc控件进度开始结束角度 lv_obj_set_size(arc, 60, 60); //设置Arc控件大小 lv_obj...原创 2021-01-03 23:32:11 · 734 阅读 · 0 评论 -
LittleGL
https://www.jianshu.com/p/185b22086631原创 2020-05-26 23:11:47 · 274 阅读 · 0 评论