รูปภาพและกราฟิกใน Compose
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การใช้องค์ประกอบภาพที่สดใสและน่าสนใจในแอป Android จะช่วยปรับปรุงรูปลักษณ์
ของแอปพลิเคชันได้ ใน Android คุณสามารถแสดงผลสิ่งต่างๆ บนหน้าจอได้หลายวิธี ไม่ว่าจะใช้เวกเตอร์ บิตแมป หรือวาดโดยตรงด้วย Canvas บนหน้าจอ ในส่วนนี้ คุณจะได้เรียนรู้
วิธีทำงานกับกราฟิกประเภทต่างๆ เหล่านี้
ดูวิธีทำงานกับรูปภาพโดยใช้รายละเอียดต่อไปนี้
- การโหลดรูปภาพ: ดูวิธีโหลด
รูปภาพจากดิสก์หรืออินเทอร์เน็ต
- ImageBitmap กับ ImageVector: ดูวิธี
ทำงานกับรูปแบบรูปภาพที่พบบ่อยที่สุด 2 รูปแบบ ได้แก่ Raster และ Vector
- ไอคอน Material: ดูวิธีที่
สะดวกในการวาดไอคอนสีเดียวบนหน้าจอตามหลักเกณฑ์ของ Material
Design 3
- ปรับแต่งรูปภาพ: ดูวิธี
ปรับแต่งรูปภาพโดยใช้พร็อพเพอร์ตี้ของ Image ที่ใช้ร่วมกันได้
- Custom painter: ดูข้อมูลเกี่ยวกับออบเจ็กต์ Custom painter เพื่อปรับแต่งรูปภาพเพิ่มเติม
- การเพิ่มประสิทธิภาพ: ดูวิธีใช้รูปภาพให้ดีที่สุดเพื่อหลีกเลี่ยงปัญหาด้านประสิทธิภาพ
นอกจากนี้ คุณยังดูข้อมูลเพิ่มเติมเกี่ยวกับการทำงานกับกราฟิกได้ที่นี่
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-21 UTC"],[],[],null,["# Images and graphics in Compose\n\nUsing bright, engaging visuals in your Android apps can help improve the look\nand feel of your application. In Android, there are a few different ways in\nwhich you can render something visually on screen- using either a vector,\nbitmap, or directly drawing with a canvas on screen. In this section, learn\nhow to work these different kinds of graphics.\n\nLearn how to work with images using these details:\n\n- [Loading images](/develop/ui/compose/graphics/images/loading): Learn how to load an image from disk or the internet\n- [ImageBitmap versus ImageVector](/develop/ui/compose/graphics/images/compare): Learn how to work with the two most common image formats, raster and vector.\n- [Material icons](/develop/ui/compose/graphics/images/material): Learn about a convenient way to draw a single color icon on the screen, following Material Design 3 guidelines.\n- [Customize an image](/develop/ui/compose/graphics/images/customize): Learn how to customize an image using properties of an Image composable.\n- [Custom painter](/develop/ui/compose/graphics/images/custompainter): Learn about custom painter objects to additionally customize your image.\n- [Optimizing performance](/develop/ui/compose/graphics/images/optimization): Learn about how to best work with images to avoid performance issues.\n\nYou can also learn more about working with Graphics [here](/develop/ui/compose/graphics/graphics-sub)."]]