ایجاد تصاویر متحرک
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
علاوه بر تصاویر ثابت بر روی صفحه ساعت، تصاویر متحرک می توانند ابعاد بیشتری را به تجربه کاربر بیاورند.
توجه داشته باشید که این بخش به طور خاص در مورد استفاده از فایل های تصویری متحرک است. با استفاده از عنصر Transform
که در صفحه Dynamically change the look of element پوشش داده شده است، می توان اجزای صفحه ساعت را متحرک کرد.
انیمیشن ها می توانند شامل یک فایل تصویر متحرک مانند یک GIF متحرک یا دنباله ای از Images
باشند که با هم ترکیب می شوند و یک انیمیشن را تشکیل می دهند.
علاوه بر مشخص کردن فایلهای مورد استفاده، باید تعریف کنید که انیمیشن چگونه باید عمل کند، به عنوان مثال، آیا پخش را حلقهای کنید، یا اگر نه، در پایان، در میان گزینههای دیگر، چه کاری انجام دهید. برای این کار از AnimationController
استفاده کنید.
در نهایت، برای همه انیمیشن ها، یک تصویر کوچک در همه انیمیشن ها قرار دهید.
با کنار هم گذاشتن اینها، یک انیمیشن پایه را می توان به صورت زیر پیاده سازی کرد:
<PartAnimatedImage x="0" y="0" width="450" height="450">
<AnimationController play="ON_VISIBLE"/>
<AnimatedImage resource="my_animation" format="AGIF"/>
<Thumbnail resource="my_animation_thumbnail" />
</PartAnimatedImage>
برای جزئیات بیشتر در مورد گنجاندن لیستی از تصاویر متحرک و ساخت انیمیشن از تصاویر ثابت، با مرجع PartAnimatedImage
مشورت کنید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Create animated images\n\nIn addition to static images on the watch face, animated images can bring a\nfurther dimension to the user experience.\n\nNote that this section is specifically about using animated image files. It is\npossible to animate components on the watch face using the `Transform` element,\nwhich is covered on the [Dynamically changing the appearance of\nelements](/training/wearables/wff/transform) page.\n\nAnimations can consist of either an animated image file, such as an animated\nGIF, or a sequence of `Images`, which combine together to form an animation.\n\nAs well as specifying the files to use, you'll need to define how the animation\nshould behave, for example, whether to loop the playback, or if not, what to do\nat the end, among other options. For this, use an [`AnimationController`](/training/wearables/wff/group/part/animated-image/animation-controller).\n\nFinally, for all animations, include a [thumbnail\nimage](/training/wearables/wff/group/part/animated-image/thumbnail) in all animations.\n\nPutting this together, a basic animation can be implemented as follows: \n\n \u003cPartAnimatedImage x=\"0\" y=\"0\" width=\"450\" height=\"450\"\u003e\n \u003cAnimationController play=\"ON_VISIBLE\"/\u003e\n \u003cAnimatedImage resource=\"my_animation\" format=\"AGIF\"/\u003e\n \u003cThumbnail resource=\"my_animation_thumbnail\" /\u003e\n \u003c/PartAnimatedImage\u003e\n\nConsult the [`PartAnimatedImage`](/training/wearables/wff/group/part/animated-image/part-animated-image) reference for more details on including a\nlist of animated images and constructing an animation from still images."]]