lv_imagebutton.h

Enums

enum lv_imagebutton_state_t

Values:

enumerator LV_IMAGEBUTTON_STATE_RELEASED
enumerator LV_IMAGEBUTTON_STATE_PRESSED
enumerator LV_IMAGEBUTTON_STATE_DISABLED
enumerator LV_IMAGEBUTTON_STATE_CHECKED_RELEASED
enumerator LV_IMAGEBUTTON_STATE_CHECKED_PRESSED
enumerator LV_IMAGEBUTTON_STATE_CHECKED_DISABLED
enumerator _LV_IMAGEBUTTON_STATE_NUM

Functions

lv_obj_t *lv_imagebutton_create(lv_obj_t *parent)

Create an image button object

Parameters:

parent -- pointer to an object, it will be the parent of the new image button

Returns:

pointer to the created image button

void lv_imagebutton_set_src(lv_obj_t *imagebutton, lv_imagebutton_state_t state, const void *src_left, const void *src_mid, const void *src_right)

Set images for a state of the image button

Parameters:
  • imagebutton -- pointer to an image button object

  • state -- for which state set the new image

  • src_left -- pointer to an image source for the left side of the button (a C array or path to a file)

  • src_mid -- pointer to an image source for the middle of the button (ideally 1px wide) (a C array or path to a file)

  • src_right -- pointer to an image source for the right side of the button (a C array or path to a file)

void lv_imagebutton_set_state(lv_obj_t *imagebutton, lv_imagebutton_state_t state)

Use this function instead of lv_obj_add/remove_state to set a state manually

Parameters:
  • imagebutton -- pointer to an image button object

  • state -- the new state

const void *lv_imagebutton_get_src_left(lv_obj_t *imagebutton, lv_imagebutton_state_t state)

Get the left image in a given state

Parameters:
  • imagebutton -- pointer to an image button object

  • state -- the state where to get the image (from lv_button_state_t) `

Returns:

pointer to the left image source (a C array or path to a file)

const void *lv_imagebutton_get_src_middle(lv_obj_t *imagebutton, lv_imagebutton_state_t state)

Get the middle image in a given state

Parameters:
  • imagebutton -- pointer to an image button object

  • state -- the state where to get the image (from lv_button_state_t) `

Returns:

pointer to the middle image source (a C array or path to a file)

const void *lv_imagebutton_get_src_right(lv_obj_t *imagebutton, lv_imagebutton_state_t state)

Get the right image in a given state

Parameters:
  • imagebutton -- pointer to an image button object

  • state -- the state where to get the image (from lv_button_state_t) `

Returns:

pointer to the left image source (a C array or path to a file)

Variables

const lv_obj_class_t lv_imagebutton_class
struct lv_imagebutton_src_info_t

Public Members

const void *img_src
lv_image_header_t header
struct lv_imagebutton_t