lv_barcode.h

Functions

lv_obj_t *lv_barcode_create(lv_obj_t *parent)

Create an empty barcode (an lv_canvas) object.

参数:

parent -- point to an object where to create the barcode

返回:

pointer to the created barcode object

void lv_barcode_set_dark_color(lv_obj_t *obj, lv_color_t color)

Set the dark color of a barcode object

参数:
  • obj -- pointer to barcode object

  • color -- dark color of the barcode

void lv_barcode_set_light_color(lv_obj_t *obj, lv_color_t color)

Set the light color of a barcode object

参数:
  • obj -- pointer to barcode object

  • color -- light color of the barcode

void lv_barcode_set_scale(lv_obj_t *obj, uint16_t scale)

Set the scale of a barcode object

参数:
  • obj -- pointer to barcode object

  • scale -- scale factor

void lv_barcode_set_direction(lv_obj_t *obj, lv_dir_t direction)

Set the direction of a barcode object

参数:
  • obj -- pointer to barcode object

  • direction -- draw direction (LV_DIR_HOR or LB_DIR_VER)

void lv_barcode_set_tiled(lv_obj_t *obj, bool tiled)

Set the tiled mode of a barcode object

参数:
  • obj -- pointer to barcode object

  • tiled -- true: tiled mode, false: normal mode (default)

lv_result_t lv_barcode_update(lv_obj_t *obj, const char *data)

Set the data of a barcode object

参数:
  • obj -- pointer to barcode object

  • data -- data to display

返回:

LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error

lv_color_t lv_barcode_get_dark_color(lv_obj_t *obj)

Get the dark color of a barcode object

参数:

obj -- pointer to barcode object

返回:

dark color of the barcode

lv_color_t lv_barcode_get_light_color(lv_obj_t *obj)

Get the light color of a barcode object

参数:

obj -- pointer to barcode object

返回:

light color of the barcode

uint16_t lv_barcode_get_scale(lv_obj_t *obj)

Get the scale of a barcode object

参数:

obj -- pointer to barcode object

返回:

scale factor

Variables

const lv_obj_class_t lv_barcode_class