Skip to content

Image~

obj:img

lv_img

Property Value Default Description
src string "" The name of the image file
auto_size bool true Automatically set the size of the image object to the image source
offset_x int16 0 Shift the picture horizontally relative to the image object
offset_y int16 0 Shift the picture vertically relative to the image object
zoom uint16 256 A larger value enlarges the images (e.g. 512 double size), a smaller value shrinks it (e.g. 128 half size). Fractional scale works as well. E.g. 281 for 10% enlargement.
angle int16 0 Rotate the picture around its pivot point. Angle has 0.1 degree precision, so for 45.8° use 458.
pivot_x int16 H center The pivot point of the rotation, by default centered
pivot_y int16 V center The pivot point of the rotation, by default centered
antialias bool false The quality of the angle and zoom transformation. With enabled anti-aliasing the transformations has a higher quality but they are slower.

Note

You can use image_recolor and image_recolor_opa from the image styling properties to apply a color overlay mask.

Either PNG or BIN image files are supported, from flash:

  • PNG image are decoded and kept in memory, thus you'll be able to display full-screen images only if your microcontroller has installed PSram memory, else you will be limited to small icons or BIN files.

  • BIN images are not stored in memory and are read from flash each time. This will be slower but allows the use of larger images even if your microcontroller doesn't have PSram.

  • BIN images from flash do not support zoom or angle transformations.

  • Use the online LVGL Image Converter to create BIN files. Set the output format to Binary or Binary RGB565.

Example jsonl
1
{"page":1,"id":34,"obj":"img","src":"L:/image.png","auto_size":0,"w":50}