ทำงานกับรูปภาพ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การใช้รูปภาพในหน้าปัดช่วยทำให้หน้าปัดมีชีวิตชีวาได้ ตั้งแต่รูปภาพพื้นหลังแบบเต็มหน้าจอไปจนถึงรูปภาพรายละเอียดแต่ละรูปเพื่อเพิ่มความน่าสนใจ
วางทรัพยากรรูปภาพในโฟลเดอร์ 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"]]