#2
林月儿2018-05-31 22:25
|
html代码
程序代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<canvas id="fisrtcanvas" width=300 height=200 style="background:rgb(109, 189, 19)">no support</canvas>
<script src="1.js">
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<canvas id="fisrtcanvas" width=300 height=200 style="background:rgb(109, 189, 19)">no support</canvas>
<script src="1.js">
</script>
</body>
</html>
js代码
程序代码:
var c = document.getElementById("firstcanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.moveTo(10,10);
ctx.lineTo(20,20);
ctx.lineWidth=1.0;
ctx.strokeStyle=red;
ctx.stroke();
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.moveTo(10,10);
ctx.lineTo(20,20);
ctx.lineWidth=1.0;
ctx.strokeStyle=red;
ctx.stroke();