canvas 为什么没有图像?
html吧
全部回复
仅看楼主
level 1
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="drawing" width="200" height="200">A drawing of something</canvas>
<script>
window.onload=function(){
var drawing=document.getElementById("drawing");
if(drawing.getContext)
{
var context=drawing.getContext("2d");
context.beginPath();
//绘制圆弧
context.arc(50,50,0,Math.PI/2,false);
context.stroke();
}
}
</script>
</body>
</html>
2018年07月13日 00点07分 1
level 3
你语法错误了
context.arc(50,50,25,0,Math.PI/2,false)
arc有六个参数
1,2圆心坐标
3圆半径
4,5圆起始和结束位置
6圆弧是顺时针画还是逆时针画,默认的是false,顺时针,此参数可选
2018年07月13日 01点07分 2
level 1
ok 谢谢老哥
2018年07月13日 05点07分 3
1