คุณสมบัติlineCapผ้าใบ HTML
ตัวอย่าง
วาดเส้นด้วยฝาท้ายมน:
จาวาสคริปต์:
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.beginPath();
ctx.lineCap = "round";
ctx.moveTo(20, 20);
ctx.lineTo(200, 20);
ctx.stroke();
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
lineCap | Yes | 9.0 | Yes | Yes | Yes |
ความหมายและการใช้งาน
คุณสมบัติ lineCap ตั้งค่าหรือส่งคืนลักษณะของ end cap สำหรับบรรทัด
หมายเหตุ:ค่า "กลม" และ "สี่เหลี่ยม" ทำให้บรรทัดยาวขึ้นเล็กน้อย
ค่าเริ่มต้น: | ก้น |
---|---|
ไวยากรณ์ JavaScript: | บริบท .lineCap="ก้น | รอบ | สี่เหลี่ยม"; |
มูลค่าทรัพย์สิน
Value | Description | Play it |
---|---|---|
butt | Default. A flat edge is added to each end of the line | |
round | A rounded end cap is added to each end of the line | |
square | A square end cap is added to each end of the line |
❮ การอ้างอิงผ้าใบ HTML