# lv_animimage.h (/api/widgets/animimage/lv_animimage_h)



<RelatedHeaders name="lv_animimage_private.h" isPrivate="false" />

<ApiSummary functions="16" enums="2" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (8)&#x22;,&#x22;Getters (5)&#x22;,&#x22;Other (3)&#x22;]">
  <ApiTab value="Setters (8)">
    <ApiMember kind="function" name="lv_animimg_set_src" file="widgets/animimage/lv_animimage.h" line="76" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L76">
      lv_animimg_set_src [#lv_animimg_set_src]

      Set the image animation images source.

      ```c title=" " lineNumbers=1
      void lv_animimg_set_src(lv_obj_t *obj, const void *dsc[], size_t num)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |
      | `dsc` | `const void *`                                   | pointer to a series images           |
      | `num` | <ApiLink name="size_t" />                        | images' number                       |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_src_reverse" file="widgets/animimage/lv_animimage.h" line="84" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L84">
      lv_animimg_set_src_reverse [#lv_animimg_set_src_reverse]

      Set the images source for flip playback of animation image.

      ```c title=" " lineNumbers=1
      void lv_animimg_set_src_reverse(lv_obj_t *obj, const void *dsc[], size_t num)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |
      | `dsc` | `const void *`                                   | pointer to a series images           |
      | `num` | <ApiLink name="size_t" />                        | images' number                       |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_duration" file="widgets/animimage/lv_animimage.h" line="103" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L103">
      lv_animimg_set_duration [#lv_animimg_set_duration]

      Set the image animation duration time. unit:ms

      ```c title=" " lineNumbers=1
      void lv_animimg_set_duration(lv_obj_t *obj, uint32_t duration)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                             | Description                          |
      | ---------- | ------------------------------------------------ | ------------------------------------ |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |
      | `duration` | <ApiLink name="uint32_t" />                      | the duration in milliseconds         |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_repeat_count" file="widgets/animimage/lv_animimage.h" line="110" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L110">
      lv_animimg_set_repeat_count [#lv_animimg_set_repeat_count]

      Set the image animation repeatedly play times.

      ```c title=" " lineNumbers=1
      void lv_animimg_set_repeat_count(lv_obj_t *obj, uint32_t count)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                                 |
      | ------- | ------------------------------------------------ | ------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object        |
      | `count` | <ApiLink name="uint32_t" />                      | the number of times to repeat the animation |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_reverse_duration" file="widgets/animimage/lv_animimage.h" line="117" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L117">
      lv_animimg_set_reverse_duration [#lv_animimg_set_reverse_duration]

      Make the image animation to play back to when the forward direction is ready.

      ```c title=" " lineNumbers=1
      void lv_animimg_set_reverse_duration(lv_obj_t *obj, uint32_t duration)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                             | Description                                                                       |
      | ---------- | ------------------------------------------------ | --------------------------------------------------------------------------------- |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object                                              |
      | `duration` | <ApiLink name="uint32_t" />                      | the duration of the playback image animation in milliseconds. 0: disable playback |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_reverse_delay" file="widgets/animimage/lv_animimage.h" line="124" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L124">
      lv_animimg_set_reverse_delay [#lv_animimg_set_reverse_delay]

      Make the image animation to play back to when the forward direction is ready.

      ```c title=" " lineNumbers=1
      void lv_animimg_set_reverse_delay(lv_obj_t *obj, uint32_t duration)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                             | Description                                                         |
      | ---------- | ------------------------------------------------ | ------------------------------------------------------------------- |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object                                |
      | `duration` | <ApiLink name="uint32_t" />                      | delay in milliseconds before starting the playback image animation. |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_start_cb" file="widgets/animimage/lv_animimage.h" line="131" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L131">
      lv_animimg_set_start_cb [#lv_animimg_set_start_cb]

      Set a function call when the animation image really starts (considering `delay`)

      ```c title=" " lineNumbers=1
      void lv_animimg_set_start_cb(lv_obj_t *obj, lv_anim_start_cb_t start_cb)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                             | Description                                 |
      | ---------- | ------------------------------------------------ | ------------------------------------------- |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object        |
      | `start_cb` | <ApiLink name="lv_anim_start_cb_t" />            | a function call when the animation is start |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_completed_cb" file="widgets/animimage/lv_animimage.h" line="138" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L138">
      lv_animimg_set_completed_cb [#lv_animimg_set_completed_cb]

      Set a function call when the animation is completed

      ```c title=" " lineNumbers=1
      void lv_animimg_set_completed_cb(lv_obj_t *obj, lv_anim_completed_cb_t completed_cb)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                             | Description                                     |
      | -------------- | ------------------------------------------------ | ----------------------------------------------- |
      | `obj`          | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object            |
      | `completed_cb` | <ApiLink name="lv_anim_completed_cb_t" />        | a function call when the animation is completed |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (5)">
    <ApiMember kind="function" name="lv_animimg_get_src" file="widgets/animimage/lv_animimage.h" line="149" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L149">
      lv_animimg_get_src [#lv_animimg_get_src]

      Get the image animation images source.

      ```c title=" " lineNumbers=1
      const void ** lv_animimg_get_src(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |

      **Returns:** `const void **` — a pointer that will point to a series images
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_get_src_count" file="widgets/animimage/lv_animimage.h" line="156" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L156">
      lv_animimg_get_src_count [#lv_animimg_get_src_count]

      Get the image animation images source.

      ```c title=" " lineNumbers=1
      uint8_t lv_animimg_get_src_count(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |

      **Returns:** <ApiLink name="uint8_t" /> — the number of source images
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_get_duration" file="widgets/animimage/lv_animimage.h" line="163" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L163">
      lv_animimg_get_duration [#lv_animimg_get_duration]

      Get the image animation duration time. unit:ms

      ```c title=" " lineNumbers=1
      uint32_t lv_animimg_get_duration(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |

      **Returns:** <ApiLink name="uint32_t" /> — the animation duration time
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_get_repeat_count" file="widgets/animimage/lv_animimage.h" line="170" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L170">
      lv_animimg_get_repeat_count [#lv_animimg_get_repeat_count]

      Get the image animation repeat play times.

      ```c title=" " lineNumbers=1
      uint32_t lv_animimg_get_repeat_count(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |

      **Returns:** <ApiLink name="uint32_t" /> — the repeat count
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_get_anim" file="widgets/animimage/lv_animimage.h" line="177" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L177">
      lv_animimg_get_anim [#lv_animimg_get_anim]

      Get the image animation underlying animation.

      ```c title=" " lineNumbers=1
      lv_anim_t * lv_animimg_get_anim(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |

      **Returns:** <ApiLink name="lv_anim_t" display="lv_anim_t *" /> — the animation reference
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (3)">
    <ApiMember kind="function" name="lv_animimg_create" file="widgets/animimage/lv_animimage.h" line="64" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L64">
      lv_animimg_create [#lv_animimg_create]

      Create an animation image objects

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_animimg_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                   |
      | -------- | ------------------------------------------------ | ------------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an object, it will be the parent of the new button |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created animation image object
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_start" file="widgets/animimage/lv_animimage.h" line="90" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L90">
      lv_animimg_start [#lv_animimg_start]

      Startup the image animation.

      ```c title=" " lineNumbers=1
      void lv_animimg_start(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_delete" file="widgets/animimage/lv_animimage.h" line="96" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L96">
      lv_animimg_delete [#lv_animimg_delete]

      Delete the image animation.

      ```c title=" " lineNumbers=1
      bool lv_animimg_delete(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                          |
      | ----- | ------------------------------------------------ | ------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an animation image object |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="_lv_property_animimage_id_t" file="widgets/animimage/lv_animimage.h" line="39" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L39">
  \_lv_property_animimage_id_t [#_lv_property_animimage_id_t]

  Modified by NXP in 2025

  | Name                                 | Value                                                                                  |
  | ------------------------------------ | -------------------------------------------------------------------------------------- |
  | `LV_PROPERTY_ANIMIMAGE_SRC`          | `(LV_PROPERTY_ANIMIMAGE_START + ((int) 0 )) \| (( 5  ) <<  28 ) \| ((  1   ) <<  24 )` |
  | `LV_PROPERTY_ANIMIMAGE_DURATION`     | `(LV_PROPERTY_ANIMIMAGE_START + ((int) 1 )) \| ((  1   ) <<  28 )`                     |
  | `LV_PROPERTY_ANIMIMAGE_REPEAT_COUNT` | `(LV_PROPERTY_ANIMIMAGE_START + ((int) 2 )) \| ((  1   ) <<  28 )`                     |
  | `LV_PROPERTY_ANIMIMAGE_SRC_COUNT`    | `(LV_PROPERTY_ANIMIMAGE_START + ((int) 3 )) \| ((  1   ) <<  28 )`                     |
  | `LV_PROPERTY_ANIMIMAGE_END`          |                                                                                        |
</ApiMember>

<ApiMember kind="enum" name="lv_animimg_part_t" file="widgets/animimage/lv_animimage.h" line="51" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L51">
  lv_animimg_part_t [#lv_animimg_part_t]

  Image parts

  | Name                      |
  | ------------------------- |
  | `LV_ANIM_IMAGE_PART_MAIN` |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_animimg_class" file="widgets/animimage/lv_animimage.h" line="48" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/animimage/lv_animimage.h#L48">
  lv_animimg_class [#lv_animimg_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_animimg_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_image.h&#x22;, &#x22;lv_types.h&#x22;]" includedBy="[&#x22;lv_animimage_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_observer.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;]" />
