lvgl.image
lvgl.image([parent, ]params)
Display an image, centered in the frame (x, y, w, h). Images can be scaled to fit entirely within the frame or to fill it completely.
Parameters
| Name | Req | Type | Description |
|---|
parent | no | object | optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window |
params | yes | table | |
| Field | Type | Description |
|---|
x | number | position relative to the top-left of the parent | y | number | position relative to the top-left of the parent | w | number | width | h | number | height | color | color or function | primary color for the object | pos | function | dynamic position callback returning x, y | size | function | dynamic size callback returning w, h | visible | function | dynamic visibility callback | floating | boolean | keep the object fixed inside a scrollable container, added in 2.11.6, defaults to false | file | string | full path to the image file on the SD card, defaults to an empty string | fill | boolean | if true the image is scaled to completely fill the frame (may be cropped); if false it is scaled to fit entirely within the frame (may have empty borders), defaults to false |
|
Returns
| Name | Type | Description |
- | table | LVGL object |
Availability
- Since:
2.11.0 - Radio support:
color-lcd
Notes
Source
radio/src/lua/api_colorlcd_lvgl.cpp