lv_example_style_9.c 619 B

123456789101112131415161718192021222324252627
  1. #include "../lv_examples.h"
  2. #if LV_BUILD_EXAMPLES && LV_USE_LINE
  3. /**
  4. * Using the line style properties
  5. */
  6. void lv_example_style_9(void)
  7. {
  8. static lv_style_t style;
  9. lv_style_init(&style);
  10. lv_style_set_line_color(&style, lv_palette_main(LV_PALETTE_GREY));
  11. lv_style_set_line_width(&style, 6);
  12. lv_style_set_line_rounded(&style, true);
  13. /*Create an object with the new style*/
  14. lv_obj_t * obj = lv_line_create(lv_scr_act());
  15. lv_obj_add_style(obj, &style, 0);
  16. static lv_point_t p[] = {{10, 30}, {30, 50}, {100, 0}};
  17. lv_line_set_points(obj, p, 3);
  18. lv_obj_center(obj);
  19. }
  20. #endif