# lv_animimage.h (/api/public/widgets/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="public/widgets/lv_animimage.h" line="73" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L73">
      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` | `size_t`                                         | images' number                       |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_src_reverse" file="public/widgets/lv_animimage.h" line="81" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L81">
      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` | `size_t`                                         | images' number                       |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_duration" file="public/widgets/lv_animimage.h" line="100" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L100">
      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` | `uint32_t`                                       | the duration in milliseconds         |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_repeat_count" file="public/widgets/lv_animimage.h" line="107" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L107">
      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` | `uint32_t`                                       | the number of times to repeat the animation |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_reverse_duration" file="public/widgets/lv_animimage.h" line="114" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L114">
      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` | `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="public/widgets/lv_animimage.h" line="121" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L121">
      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` | `uint32_t`                                       | delay in milliseconds before starting the playback image animation. |
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_set_start_cb" file="public/widgets/lv_animimage.h" line="128" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L128">
      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="public/widgets/lv_animimage.h" line="135" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L135">
      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="public/widgets/lv_animimage.h" line="146" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L146">
      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="public/widgets/lv_animimage.h" line="153" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L153">
      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:** `uint8_t` — the number of source images
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_get_duration" file="public/widgets/lv_animimage.h" line="160" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L160">
      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:** `uint32_t` — the animation duration time
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_get_repeat_count" file="public/widgets/lv_animimage.h" line="167" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L167">
      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:** `uint32_t` — the repeat count
    </ApiMember>

    <ApiMember kind="function" name="lv_animimg_get_anim" file="public/widgets/lv_animimage.h" line="174" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L174">
      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="public/widgets/lv_animimage.h" line="61" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L61">
      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 a parent widget **May** be `NULL`.. When NULL, the widget is created as a screen on the default display. |

      **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="public/widgets/lv_animimage.h" line="87" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L87">
      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="public/widgets/lv_animimage.h" line="93" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L93">
      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 **May** be `NULL`. |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="_lv_property_animimage_id_t" file="public/widgets/lv_animimage.h" line="35" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L35">
  \_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="public/widgets/lv_animimage.h" line="47" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L47">
  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="public/widgets/lv_animimage.h" line="44" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_animimage.h#L44">
  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;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.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_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_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_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_timer.h&#x22;]" />
