2023-04-27 06:42:02 -06:00
|
|
|
=======
|
|
|
|
Barcode
|
|
|
|
=======
|
|
|
|
|
|
|
|
Barcode generation with LVGL. Uses
|
|
|
|
`code128 <https://github.com/fhunleth/code128>`__ by
|
|
|
|
`fhunleth <https://github.com/fhunleth>`__.
|
|
|
|
|
|
|
|
Usage
|
|
|
|
-----
|
|
|
|
|
|
|
|
Enable :c:macro:`LV_USE_BARCODE` in ``lv_conf.h``.
|
|
|
|
|
|
|
|
Use :c:expr:`lv_barcode_create()` to create a barcode object, and use
|
|
|
|
:c:expr:`lv_barcode_update()` to generate a barcode.
|
|
|
|
|
|
|
|
Call :c:expr:`lv_barcode_set_scale()` or :c:expr:`lv_barcode_set_dark/light_color()`
|
2023-09-25 03:41:24 +08:00
|
|
|
to adjust scaling and color, call :c:expr:`lv_barcode_set_direction()` will set
|
|
|
|
direction to display, and call :c:expr:`lv_barcode_update()` again to regenerate
|
|
|
|
the barcode.
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
Notes
|
|
|
|
-----
|
|
|
|
|
|
|
|
- It is best not to manually set the width of the barcode, because when
|
|
|
|
the width of the object is lower than the width of the barcode, the
|
|
|
|
display will be incomplete due to truncation.
|
|
|
|
- The scale adjustment can only be an integer multiple, for example,
|
|
|
|
:c:expr:`lv_barcode_set_scale(barcode, 2)` means 2x scaling.
|
2023-09-25 03:41:24 +08:00
|
|
|
- The direction adjustment can be `LV_DIR_HOR` or `LV_DIR_VER`
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
Example
|
|
|
|
-------
|
|
|
|
|
|
|
|
.. include:: ../examples/libs/barcode/index.rst
|
|
|
|
|
|
|
|
API
|
|
|
|
---
|
|
|
|
|
|
|
|
:ref:`code128`
|
2023-05-08 08:45:28 -06:00
|
|
|
|