עבודה עם תמונות
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
שימוש בתמונות בתצוגת השעון יכול לעזור להפוך אותה למיוחדת יותר, החל מתמונת רקע במסך מלא ועד לתמונות מפורטות ספציפיות.
מניחים את משאבי התמונות בתיקייה res/drawable
, למשל res/drawable/face.png
, ולאחר מכן מפנים לתמונה באופן הבא:
<PartImage x="100" y="100" width="250" height="250">
<Image resource="face"/>
</PartImage>
אפשר לשנות את הרכיב PartImage
, כמו קונטיינרים אחרים בפורמט של תצוגת שעון, בדרכים רבות, כולל שינוי קנה המידה, סיבוב, טרנספורמציה, הוספת גוון או הוספת מסכה.
מידע נוסף זמין במסמך העזרה של PartImage
.
שינוי הרקע
אחד מהאפקטים שיכולים לעורר עניין הוא שינוי הרקע כל שעה.
אפשר לעשות זאת באמצעות הרכיב Images
, לדוגמה:
<PartImage ...>
<Images change="ON_NEXT_HOUR">
<Image resource="background1"/>
<Image resource="background2"/>
...
</Images>
</PartImage>
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# Work with images\n\nUsing images in your watch face can really help bring it to life, from a\nfull-screen background image to individual detail images to add interest.\n\nPlace your image resources in the `res/drawable` folder, for example\n`res/drawable/face.png`, and then reference the image as follows: \n\n \u003cPartImage x=\"100\" y=\"100\" width=\"250\" height=\"250\"\u003e\n \u003cImage resource=\"face\"/\u003e\n \u003c/PartImage\u003e\n\nThe `PartImage` element, as with other containers in Watch Face Format,\ncan be modified in\nmany ways, including being scaled, rotated, transformed, tinted, or masked.\nSee the [`PartImage`](/training/wearables/wff/group/part/image/part-image) reference for more information.\n\n### Vary the background\n\nOne effect that can provide interest is to change the background every hour.\nThis can be achieved through the use of the `Images` element, for example: \n\n \u003cPartImage ...\u003e\n \u003cImages change=\"ON_NEXT_HOUR\"\u003e\n \u003cImage resource=\"background1\"/\u003e\n \u003cImage resource=\"background2\"/\u003e\n ...\n \u003c/Images\u003e\n \u003c/PartImage\u003e"]]