Kommentar: HTML5 -Leinwand zeichnen Zeilen Closepath () Beispielcode, Freunde, die ihn benötigen, können sich darauf beziehen
Kerncode:$ (function () {
var can = $ ("#Can"). Get (0);
var txi = can.getContext ("2d");
txi.beginPath ();
txi.moveto (105,105);
txi.lineto (105,45);
txi.lineto (45,105);
txi.closepath ();
txi.stroke ();
txi.beginPath ();
txi.moveto (25,25);
txi.lineto (100,25);
txi.lineto (25.100);
txi.stroke ();
})
<Canvas> </canvas>
conepath (); conepath (); schließt den Weg
Das folgende Bild zeigt eine verwendete, geschlossene und die andere ist nutzlos: