已采纳回答 / 孙大梅其实不叫孙大梅3944196
不是大神。。复制到本地f12马上就知道错误了。。第7行 document.getElementsById('canvas'); 应该是 document.getElementById('canvas');学会调试~~
2017-10-25
话说有点好奇每次都clearRect 然后再重新绘制,这样子会不会造成一点性能的影响?还是说基本动画实现原理都是这样子的
2017-10-25
{p:[{x:600,y:200},{x:600,y:600},{x:400,y:400}],color:"#f9f51a"},
{p:[{x:400,y:400},{x:600,y:600},{x:400,y:800},{x:200,y:600}],color:"#a594c0"},
{p:[{x:200,y:600},{x:400,y:800},{x:0,y:800}],color:"#fa8ecc"},
{p:[{x:400,y:400},{x:600,y:600},{x:400,y:800},{x:200,y:600}],color:"#a594c0"},
{p:[{x:200,y:600},{x:400,y:800},{x:0,y:800}],color:"#fa8ecc"},
2017-10-18
{p:[{x:0,y:0},{x:800,y:0},{x:400,y:400}],color:"#caff67"},
{p:[{x:0,y:0},{x:400,y:400},{x:0,y:800}],color:"#67becf"},
{p:[{x:800,y:400},{x:800,y:800},{x:400,y:800}],color:"#f6ca29"}
{p:[{x:800,y:0},{x:800,y:400},{x:600,y:600},{x:600,y:200}],color:"#ef3d61"},
{p:[{x:0,y:0},{x:400,y:400},{x:0,y:800}],color:"#67becf"},
{p:[{x:800,y:400},{x:800,y:800},{x:400,y:800}],color:"#f6ca29"}
{p:[{x:800,y:0},{x:800,y:400},{x:600,y:600},{x:600,y:200}],color:"#ef3d61"},
2017-10-18
最新回答 / 丹恪梦
<!doctype html&t; &t;hhtml lang="zh-CN"&; & &;hehead&; &a cmeta charset="UTF-8"& &l &e="meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"&htt ...
2017-10-17
最新回答 / Ma91c
半径的单位是像素,canvas宽度时200px,里面的圆的半径是100px,因为有10px的border,会有部分border显示时被遮挡,所以半径设为了r-5,即95px
2017-10-17
最新回答 / 凯百万
使用 context.moveTo(100,100);context.lineTo(700,700);context.lineTo(100,700);context.lineTo(100,100);路径才能填充颜色
2017-10-13
画圆弧时context.fill()和context.closePath()还是的闭合效果有些区别的,context.fill()接口处会出现锯齿,而closePath()会添加新边框,如果填充样式颜色不一致,边框是不同的颜色。