ImageFill
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวเลือกการแสดงรูปภาพที่เป็นไปได้ซึ่งส่งผลต่อการนําเสนอรูปภาพ ซึ่งควรใช้ในกรณีที่สัดส่วนภาพของรูปภาพไม่ตรงกับสัดส่วนภาพของคอนเทนเนอร์รูปภาพ
Enum |
UNSPECIFIED |
ไม่ระบุ ImageFill |
GRAY |
เติมเต็มช่องว่างระหว่างรูปภาพและคอนเทนเนอร์รูปภาพด้วยแถบสีเทา |
WHITE |
อุดช่องว่างระหว่างรูปภาพและคอนเทนเนอร์รูปภาพด้วยแถบสีขาว |
CROPPED |
รูปภาพจะมีการปรับขนาดเพื่อให้ความกว้างและความสูงของรูปภาพตรงกันหรือเกินขนาดของคอนเทนเนอร์ โดยสามารถครอบตัดด้านบนและด้านล่างของรูปภาพได้ในกรณีที่ความสูงของรูปภาพที่มีการปรับขนาดใหญ่กว่าความสูงของคอนเทนเนอร์ หรือครอบตัดด้านซ้ายและขวาของรูปภาพหากมีความกว้างสําหรับการปรับขนาดรูปภาพมากกว่าความกว้างของคอนเทนเนอร์ ซึ่งจะคล้ายกับ "โหมดซูม" บนจอกว้างเมื่อเล่นวิดีโอขนาด 4:3 |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 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-07-26 UTC"],[[["\u003cp\u003eImage display options control how an image is presented within its container, especially when aspect ratios differ.\u003c/p\u003e\n"],["\u003cp\u003eOptions include filling the surrounding space with gray or white bars or cropping the image to fit.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCROPPED\u003c/code\u003e scales the image to fill the container, potentially cropping parts that extend beyond its boundaries, similar to "Zoom Mode" on a widescreen TV.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can choose an option to optimize image presentation based on the specific needs of their website or application.\u003c/p\u003e\n"]]],["The provided information outlines image display options when an image's aspect ratio differs from its container. `GRAY` and `WHITE` options fill the resulting gaps with gray or white bars, respectively. `CROPPED` scales the image to match or exceed container dimensions, potentially cropping the top/bottom or left/right edges. An `UNSPECIFIED` option exists, but its behavior is undefined. These settings control how the image is presented within its designated container.\n"],null,[]]