mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
f753265a79
BREAKING CHANGE This is a huge update which introduces parallel rendering. lv_conf.h needs to be updated too.
29 lines
736 B
C
29 lines
736 B
C
#include "../../lv_examples.h"
|
|
#if LV_USE_BARCODE && LV_BUILD_EXAMPLES
|
|
|
|
/**
|
|
* Create a Barcode
|
|
*/
|
|
void lv_example_barcode_1(void)
|
|
{
|
|
lv_color_t bg_color = lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 5);
|
|
lv_color_t fg_color = lv_palette_darken(LV_PALETTE_BLUE, 4);
|
|
|
|
lv_obj_t * barcode = lv_barcode_create(lv_scr_act());
|
|
lv_obj_set_height(barcode, 50);
|
|
lv_obj_center(barcode);
|
|
|
|
/*Set color*/
|
|
lv_barcode_set_dark_color(barcode, fg_color);
|
|
lv_barcode_set_light_color(barcode, bg_color);
|
|
|
|
/*Add a border with bg_color*/
|
|
lv_obj_set_style_border_color(barcode, bg_color, 0);
|
|
lv_obj_set_style_border_width(barcode, 5, 0);
|
|
|
|
/*Set data*/
|
|
lv_barcode_update(barcode, "https://lvgl.io");
|
|
}
|
|
|
|
#endif
|