Home > Web Front-end > H5 Tutorial > html5 Canvas draws lines closePath() example code _html5 tutorial skills

html5 Canvas draws lines closePath() example code _html5 tutorial skills

WBOY
Release: 2016-05-16 15:51:09
Original
1554 people have browsed it

Core code:

Copy code
The code is as follows:

$(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();
})


Copy code
The code is as follows:



closePath(); Close the path
The picture below is one that uses, close, One is useless:

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template