SVG <polygon>

<polygon> สัญลักษณ์ที่ใช้สร้างรูปที่มีขอบอย่างน้อยสามขอบ

<polygon> สัญลักษณ์

<polygon> สัญลักษณ์ที่ใช้สร้างรูปที่มีขอบอย่างน้อยสามขอบ

โปรดคัดลอกโค้ดด้านล่างไปยังบันทึกข้อความ และบันทึกไฟล์เป็น "polygon1.svg" โปรดใส่ไฟล์นี้ลงในไดเรกทอรี web ของคุณ:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<polygon points="220,100 300,210 170,250"}
style="fill:#cccccc;
stroke:#000000;stroke-width:1"/>
</svg>

การอธิบายรหัส

ตัวแปร points กำหนดตำแหน่ง x และ y ของแม่นะของรูปทรงหลายมุม

ดูตัวอย่าง

ตัวอย่างด้านล่างนี้สร้างสี่เหลี่ยม

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">
<polygon points="220,100 300,210 170,250 123,234"
style="fill:#cccccc;
stroke:#000000;stroke-width:1"/>
</svg>

ดูตัวอย่าง