lv_imagebutton.h
API reference for lv_imagebutton.h
Functions
lv_imagebutton_set_src
Set images for a state of the image button
void lv_imagebutton_set_src(lv_obj_t *obj, lv_imagebutton_state_t state, const void *src_left, const void *src_mid, const void *src_right)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | for which state set the new image |
src_left | const void * | pointer to an image source for the left side of the button (a C array or path to a file) May be NULL. When NULL the left side is not drawn. |
src_mid | const void * | pointer to an image source for the middle of the button (ideally 1px wide) (a C array or path to a file) May be NULL. When NULL the middle is not drawn. |
src_right | const void * | pointer to an image source for the right side of the button (a C array or path to a file) May be NULL. When NULL the right side is not drawn. |
lv_imagebutton_set_src_left
Set the left image for a state of the image button
void lv_imagebutton_set_src_left(lv_obj_t *obj, lv_imagebutton_state_t state, const void *src_left)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | for which state set the new image |
src_left | const void * | pointer to an image source for the left side of the button (a C array or path to a file) May be NULL. When NULL the left side is not drawn. |
lv_imagebutton_set_src_right
Set the right image for a state of the image button
void lv_imagebutton_set_src_right(lv_obj_t *obj, lv_imagebutton_state_t state, const void *src_right)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | for which state set the new image |
src_right | const void * | pointer to an image source for the right side of the button (a C array or path to a file) May be NULL. When NULL the right side is not drawn. |
lv_imagebutton_set_src_mid
Set the middle image for a state of the image button
void lv_imagebutton_set_src_mid(lv_obj_t *obj, lv_imagebutton_state_t state, const void *src_mid)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | for which state set the new image |
src_mid | const void * | pointer to an image source for the middle of the button (a C array or path to a file) May be NULL. When NULL the middle is not drawn. |
lv_imagebutton_set_state
Use this function instead of lv_obj_add/remove_state to set a state manually
void lv_imagebutton_set_state(lv_obj_t *obj, lv_imagebutton_state_t state)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | the new state |
lv_imagebutton_get_src_left
Get the left image in a given state
const void * lv_imagebutton_get_src_left(lv_obj_t *obj, lv_imagebutton_state_t state)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | the state where to get the image (from lv_imagebutton_state_t) |
Returns: const void * — pointer to the left image source (a C array or path to a file)
lv_imagebutton_get_src_middle
Get the middle image in a given state
const void * lv_imagebutton_get_src_middle(lv_obj_t *obj, lv_imagebutton_state_t state)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | the state where to get the image (from lv_button_state_t) |
Returns: const void * — pointer to the middle image source (a C array or path to a file)
lv_imagebutton_get_src_right
Get the right image in a given state
const void * lv_imagebutton_get_src_right(lv_obj_t *obj, lv_imagebutton_state_t state)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an image button object |
state | lv_imagebutton_state_t | the state where to get the image (from lv_button_state_t) |
Returns: const void * — pointer to the left image source (a C array or path to a file)
lv_imagebutton_create
Create an image button object
lv_obj_t * lv_imagebutton_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a parent widget May be NULL.. When NULL, the widget is created as a screen on the default display. |
Returns: lv_obj_t * — pointer to the created image button
Enums
lv_imagebutton_state_t
| Name |
|---|
LV_IMAGEBUTTON_STATE_RELEASED |
LV_IMAGEBUTTON_STATE_PRESSED |
LV_IMAGEBUTTON_STATE_DISABLED |
LV_IMAGEBUTTON_STATE_CHECKED_RELEASED |
LV_IMAGEBUTTON_STATE_CHECKED_PRESSED |
LV_IMAGEBUTTON_STATE_CHECKED_DISABLED |
LV_IMAGEBUTTON_STATE_NUM |
Used by 8 functions
lv_imagebutton_set_src— paramstatelv_imagebutton_set_src_left— paramstatelv_imagebutton_set_src_right— paramstatelv_imagebutton_set_src_mid— paramstatelv_imagebutton_set_state— paramstatelv_imagebutton_get_src_left— paramstatelv_imagebutton_get_src_middle— paramstatelv_imagebutton_get_src_right— paramstate
Variables
lv_imagebutton_class
const lv_obj_class_t lv_imagebutton_classDependencies
Indirect dependencies
lv_anim.hlv_area.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.hlv_display.hlv_draw.hlv_draw_arc.hlv_draw_blur.hlv_draw_buf.hlv_draw_image.hlv_draw_label.hlv_draw_line.hlv_draw_rect.hlv_draw_triangle.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_fs.hlv_grad.hlv_grid.hlv_group.hlv_image_decoder.hlv_image_dsc.hlv_indev.hlv_layout.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_obj_class.hlv_obj_draw.hlv_obj_event.hlv_obj_pos.hlv_obj_property.hlv_obj_scroll.hlv_obj_style.hlv_obj_style_gen.hlv_obj_tree.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_symbol_def.hlv_text.hlv_timer.hlv_types.h
Last updated on