Image Button (lv_imagebutton)
A button that draws per-state images instead of a styled rectangle.
Overview
The Image Button behaves like a Button but draws user-supplied images per state instead of a styled rectangle. Separate left, middle and right images can be set; the middle image is tiled to fill the width.
Learn more in the LVGL Open documentation.
Enumerations
lv_imagebutton_state — Possible states of an image button
| Value | Description |
|---|---|
released | Released |
pressed | Pressed |
disabled | Disabled |
checked_released | Checked and released |
checked_pressed | Checked and pressed |
checked_disabled | Checked and disabled |
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.
| Part | Description |
|---|---|
main | Style the button: background, text and image_recolor/image_recolor_opa properties. The shown left/mid/right images change with the state (released, pressed, disabled, checked_*). |
Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.
| Property | Type | Description |
|---|---|---|
state | enum:lv_imagebutton_state | The current state of the imagebutton |
<lv_imagebutton-src_left>
Set the left image source in a given state
access set
| Name | Kind | Type | Description |
|---|---|---|---|
state | arg | enum:lv_imagebutton_state | Set the image in this state |
src | arg | image | The image in the given state |
<lv_imagebutton-src_right>
Set the right image source in a given state
access set
| Name | Kind | Type | Description |
|---|---|---|---|
state | arg | enum:lv_imagebutton_state | Set the image in this state |
src | arg | image | The image in the given state |
<lv_imagebutton-src_mid>
Set the middle image source in a given state
access set
| Name | Kind | Type | Description |
|---|---|---|---|
state | arg | enum:lv_imagebutton_state | Set the image in this state |
src | arg | image | The image in the given state |
Last updated on