lv_obj_t *scr= lv_disp_get_scr_act(NULL); /* 获取当前屏幕 */ lv_obj_t * img1 = lv_img_create(lv_scr_act(), NULL); lv_img_set_src(img1, &wavrshare_btn); lv_obj_align(img1, NULL, LV_ALIGN_CENTER, 0, -20); //下面使用的是自带图标 lv_obj_t * img2 = lv_img_cre...
Powerful and easy-to-use embedded GUI library with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash). - lvgl/src/core/lv_obj_tree.c at 780e0efe2ce0703dc23ddc39623b279639a0be10 · bo
lv_event_code_t code = lv_event_get_code(e); switch (code) { case LV_EVENT_CLICKED: { lv_disp_t * d = lv_obj_get_disp(lv_scr_act()); if (d->prev_scr == NULL && d->scr_to_load == NULL) { setup_scr_screen2(&guider_ui); ...
if(act_scr_del) { if(act_scr_del) { LV_LOG_WARN("the active screen was deleted") disp->act_scr = NULL; } @@ -159,8 +161,8 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent) /*Remove the object from the old parent's child list*/ int32_t i; for(i ...
voidlv_obj_invalidate_area(constlv_obj_t*obj,constlv_area_t*area){LV_ASSERT_OBJ(obj,MY_CLASS);lv_area_t area_tmp;lv_area_copy(&area_tmp,area);bool visible=lv_obj_area_is_visible(obj,&area_tmp);if(visible)_lv_inv_area(lv_obj_get_disp(obj),&area_tmp);} ...
Will be expanded to: void <name> (lv_obj_t * obj, lv_event_t e) Examples: static LV_EVENT_CB_DECLARE(my_event1); //Protoype declaration static LV_EVENT_CB_DECLARE(my_event1) { if(e == LV_EVENT_CLICKED) { lv_obj_set_hidden(obj ,true); } } ...
初始化lv_disp_draw_buf_t && lv_disp_drv_t这两个结构体然后对应初始化绘制缓冲区的内部图形缓冲区,显示驱动程序。 初始化缓存区 对于lv_disp_draw_buf_t: 复制 /*一个静态或全局变量来存储缓冲区*/staticlv_disp_draw_buf_tdisp_buf;/*静态或全局缓冲区(s)。第二个缓冲区是可选的*/staticlv_color...
#scr = lv.obj() #scr===> screen 屏幕 fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') #先定义界面元素 scr = lv.scr_act() btn = lv.btn(scr) btn1=lv.btn(scr) btn2=lv.btn(scr) label =lv.label(btn) label...
#scr = lv.obj() #scr===> screen 屏幕 fs_drv = lv.fs_drv_t() fs_driver.fs_register(fs_drv, 'S') #先定义界面元素 scr = lv.scr_act() btn = lv.btn(scr) btn1=lv.btn(scr) btn2=lv.btn(scr) label =lv.label(btn) label...
//显示屏初始化WIDTH=width;HEIGHT=height;buf=newuint32_t[WIDTH*HEIGHT];lv_disp_draw_buf_init(&lv_disp_buf,lv_buf_1,lv_buf_2,DISP_BUF_SIZE);staticlv_disp_drv_t disp_drv;lv_disp_drv_init(&disp_drv);disp_drv.hor_res=WIDTH;disp_drv.ver_res=HEIGHT;disp_drv.draw_buf=&lv_disp_buf...