Image (lv_image)

Displays images from arrays or files, with recolor, scale and rotation.

Overview

The Image widget displays images from compiled-in arrays or from files. It can recolor, scale, rotate and tile its source, and supports custom formats through the image decoder interface.

Learn more in the LVGL Open documentation.

Enumerations

lv_image_align — How the image is placed inside its container

ValueDescription
defaultAlign top-left (same as top_left)
top_leftAlign to top-left
top_midAlign to top-center
top_rightAlign to top-right
bottom_leftAlign to bottom-left
bottom_midAlign to bottom-center
bottom_rightAlign to bottom-right
left_midAlign to left-center
right_midAlign to right-center
centerAlign to center
stretchStretch to fill the widget
tileTile to fill the widget
containScale to fit inside while keeping aspect ratio
coverScale to fully cover while keeping aspect ratio

Properties

Parts

Style parts of the widget with local style (e.g. style_bg_color-knob="0xff0000") or with style sheets (e.g. <style name="style_knob" selector="knob">). See Styles to learn more.

PartDescription
mainStyle the image: image_recolor, image_recolor_opa, image_opa and the transform properties (scale/rotation). Background, border, etc can be added too.

Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.

PropertyTypeDescription
srcimageSet the image source (file, symbol, or variable)
inner_alignenum:lv_image_alignAlign and scale the image inside
rotationintRotate the image (degrees)
scale_xintScale horizontally (100 = original)
scale_yintScale vertically (100 = original)
pivot_xint|%Set the pivot X for rotation/scaling
pivot_yint|%Set the pivot Y for rotation/scaling
bind_srcsubject:pointerBind the image source to a pointer subject

Last updated on

On this page