2024-01-04 07:25:13 +01:00
|
|
|
.. _lv_animimg:
|
|
|
|
|
|
|
|
============================
|
2023-04-27 06:42:02 -06:00
|
|
|
Animation Image (lv_animimg)
|
|
|
|
============================
|
|
|
|
|
|
|
|
Overview
|
|
|
|
********
|
|
|
|
|
2024-10-23 12:53:33 -06:00
|
|
|
The animation image is similar to the normal 'Image' Widget. The only
|
2023-04-27 06:42:02 -06:00
|
|
|
difference is that instead of one source image, you set an array of
|
2024-10-23 12:53:33 -06:00
|
|
|
multiple source images that supply "frames" in an animation.
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
You can specify a duration and repeat count.
|
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _lv_animimg_parts_and_styles:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Parts and Styles
|
|
|
|
****************
|
|
|
|
|
2024-12-08 15:13:21 -07:00
|
|
|
- :cpp:enumerator:`LV_PART_MAIN` A background rectangle that uses the :ref:`typical
|
|
|
|
background style properties <typical bg props>` and the image itself using the image
|
2023-04-27 06:42:02 -06:00
|
|
|
style properties.
|
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _lv_animimg_usage:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Usage
|
|
|
|
*****
|
|
|
|
|
|
|
|
Image sources
|
|
|
|
-------------
|
|
|
|
|
2024-11-04 02:42:40 -07:00
|
|
|
To set the image animation images sources, use
|
|
|
|
:cpp:expr:`lv_animimg_set_src(animimg, dsc[], num)`.
|
2023-04-27 06:42:02 -06:00
|
|
|
|
2024-09-20 10:50:17 +02:00
|
|
|
Using the inner animation
|
|
|
|
-------------------------
|
|
|
|
|
2024-11-04 02:42:40 -07:00
|
|
|
For more advanced use cases, the animation used internally by the image can be
|
|
|
|
retrieved using :cpp:expr:`lv_animimg_get_anim(animimg)`. Using this, you can
|
|
|
|
use the :ref:`Animation <animation>` functions, for example, to
|
2024-09-20 10:50:17 +02:00
|
|
|
override the animation values using the
|
|
|
|
:cpp:expr:`lv_anim_set_values(anim, start, end)` or to set a callback
|
|
|
|
on the animation completed event.
|
|
|
|
|
2024-10-23 12:53:33 -06:00
|
|
|
|
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _lv_animimg_events:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Events
|
|
|
|
******
|
|
|
|
|
2024-10-23 12:53:33 -06:00
|
|
|
No special events are sent by Animation-Image Widgets.
|
|
|
|
|
|
|
|
.. admonition:: Further Reading
|
|
|
|
|
|
|
|
Learn more about :ref:`lv_obj_events` emitted by all Widgets.
|
|
|
|
|
|
|
|
Learn more about :ref:`events`.
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _lv_animimg_keys:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Keys
|
|
|
|
****
|
|
|
|
|
2024-10-23 12:53:33 -06:00
|
|
|
No *Keys* are processed by Animation-Image Widgets.
|
|
|
|
|
|
|
|
.. admonition:: Further Reading
|
|
|
|
|
|
|
|
Learn more about :ref:`indev_keys`.
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
|
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _lv_animimg_example:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
Example
|
|
|
|
*******
|
|
|
|
|
2024-10-23 12:53:33 -06:00
|
|
|
.. include:: ../../examples/widgets/animimg/index.rst
|
|
|
|
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
|
2024-01-04 07:25:13 +01:00
|
|
|
.. _lv_animimg_api:
|
|
|
|
|
2023-04-27 06:42:02 -06:00
|
|
|
API
|
|
|
|
***
|