init Files
This commit is contained in:
27
libraries/lvgl/examples/widgets/bar/lv_example_bar_4.c
Normal file
27
libraries/lvgl/examples/widgets/bar/lv_example_bar_4.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Bar with stripe pattern and ranged value
|
||||
*/
|
||||
void lv_example_bar_4(void)
|
||||
{
|
||||
LV_IMAGE_DECLARE(img_skew_strip);
|
||||
static lv_style_t style_indic;
|
||||
|
||||
lv_style_init(&style_indic);
|
||||
lv_style_set_bg_image_src(&style_indic, &img_skew_strip);
|
||||
lv_style_set_bg_image_tiled(&style_indic, true);
|
||||
lv_style_set_bg_image_opa(&style_indic, LV_OPA_30);
|
||||
|
||||
lv_obj_t * bar = lv_bar_create(lv_screen_active());
|
||||
lv_obj_add_style(bar, &style_indic, LV_PART_INDICATOR);
|
||||
|
||||
lv_obj_set_size(bar, 260, 20);
|
||||
lv_obj_center(bar);
|
||||
lv_bar_set_mode(bar, LV_BAR_MODE_RANGE);
|
||||
lv_bar_set_value(bar, 90, LV_ANIM_OFF);
|
||||
lv_bar_set_start_value(bar, 20, LV_ANIM_OFF);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user