页次: 1
@DDER
https://whycan.com/files/members/15818/hexdump_jpg.png感谢成功读取到KEY。
电容都好脆了。。。不小心怼碎了。。。https://whycan.com/files/members/15818/IMG_5031.jpeg
这个读到的是啥?input 设备 有触摸屏?
这个是我创建win的代码
想创建一个button 然后label 在button的右边但是不行
static lv_style_t win_style;
lv_style_copy(&win_style, &lv_style_transp);
lv_obj_t * win = lv_win_create(lv_disp_get_scr_act(NULL),NULL);
lv_obj_set_size(win, 200, LV_VER_RES / 2);
lv_obj_set_pos(win, pPoint->x, pPoint->y);
lv_obj_set_top(win, true);
lv_win_set_style(win, LV_WIN_STYLE_CONTENT, &win_style);
static lv_style_t win_head_style;
lv_style_copy(&win_head_style, &lv_style_pretty_color);
win_head_style.body.opa = 128;
win_head_style.text.font = &lv_font_chinese_24;
win_head_style.text.color =LV_COLOR_RED;
lv_win_set_style(win, LV_WIN_STYLE_HEADER, &win_head_style);
lv_obj_t * win_close_btn=lv_win_add_btn(win, LV_SYMBOL_CLOSE);
lv_obj_set_event_cb(win_close_btn, lv_win_close_event_cb);
lv_win_set_title(win, "快捷菜单");
lv_win_set_layout(win,LV_LAYOUT_COL_L);
static lv_style_t label_style1;
lv_style_copy(&label_style1, &lv_style_plain_color);
label_style1.text.font = &lv_font_chinese_24;
lv_obj_t *btn1 = lv_btn_create(win, NULL);
lv_btn_set_toggle(btn1, true);
lv_obj_set_event_cb(btn1, my_event_cb);
lv_obj_align(btn1, win, LV_ALIGN_IN_TOP_LEFT, 0, 0);
lv_obj_t *btn1_label = lv_label_create(btn1, NULL);
lv_label_set_text(btn1_label, "主菜单");
lv_label_set_style(btn1_label,LV_LABEL_STYLE_MAIN,&label_style1);
lv_obj_align(btn1_label,btn1, LV_ALIGN_OUT_BOTTOM_RIGHT, 0, 0);
出现的窗口button和label没有对齐
1. 在lvgl的配置文件中修改宏定义 => lvgl_conf.h , 是用来做图层叠加的,比如OSD之类的功能。
#define LV_COLOR_SCREEN_TRANSP 0
2. 修改源文件 src/lv_hal/lv_hal_disp.c,修改的目的就是把默认的显示变为32位位启用透明。
lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver)
=> add lv_obj_set_style(disp->act_scr, &lv_style_transp);
此时假设你的视频输出在/dev/fb1上,而UI的话在/dev/fb0上就能够看到叠加效果了。
楼主的意思应该是在同一个/dev/fb0 上分为图形层和视频层,希望图形层也就是gui的东西不要挡住视频层的东西
您的意思是#define LV_COLOR_SCREEN_TRANSP 1
然后在src/lv_hal/lv_hal_disp.c 143行下面添加 lv_obj_set_style(disp->act_scr, &lv_style_transp); 么
I'm from Hungary and was born in 1990. I was 17 years old when I started to work with electronics. I have some experience with hardware design but most of the time I'm writing embedded software in C.
I created the first, experimental version of the LittlevGL for my hobby projects in 2009. Since then it was rewritten and published on GitHub in 2016.
Besides coding, I needed to learn a lot about SEO (Search Engine Optimization), marketing, web programming and design.
And finally a little bit of personal thing: since December 2018 we are happy parents of our first baby, called Zakariás (Zachary in English)
页次: 1