إنشاء صور متحركة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بالإضافة إلى الصور الثابتة على خلفية شاشة الساعة، يمكن أن تضفي الصور المتحركة مزيدًا من البهجة على تجربة المستخدم.
يُرجى العِلم أنّ هذا القسم يتناول استخدام ملفات الصور المتحركة على وجه التحديد. يمكن
إضافة تأثيرات متحركة إلى المكوّنات على خلفية شاشة الساعة باستخدام العنصر Transform
،
والذي يتم تناوله في صفحة تغيير مظهر العناصر
بشكل ديناميكي.
يمكن أن تتألف الصور المتحركة من ملف صورة متحركة، مثل ملف GIF متحركة، أو تسلسل من Images
، والتي يتم دمجها معًا لإنشاء صورة متحركة.
بالإضافة إلى تحديد الملفات التي تريد استخدامها، عليك تحديد كيفية تصرف الصورة المتحركة، على سبيل المثال، ما إذا كنت تريد تكرار التشغيل أو ما تريد فعله في نهاية التشغيل، إلى جانب خيارات أخرى. لإجراء ذلك، استخدِم AnimationController
.
أخيرًا، أدرِج صورة thumbnail في كل الصور المتحركة.
عند تجميع هذه العناصر معًا، يمكن تنفيذ صورة متحركة أساسية على النحو التالي:
<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
للحصول على مزيد من التفاصيل حول تضمين قائمة بالصور المتحركة وإنشاء صورة متحركة من الصور الثابتة.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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."]]