-
动画基础查看全部
-
closePath()如果当前路径未封闭,会自动封闭路径查看全部
-
绘制弧度说明查看全部
-
绘制弧或者圆查看全部
-
绘制基础,填充和路径颜色查看全部
-
context.beginPath()和context.closePath()可以控制路径的开始和结束查看全部
-
var TG =[ {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:0},{x:800,y:400},{x:600,y:600},{x:600,y:200}],color:"#ef3d61"}, {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:800,y:400},{x:800,y:800},{x:400,y:800}],color:"#f6ca29"} ] window.onload=function(){ var canvas=document.getElementById("canvas"); canvas.width=800; canvas.height=800; var context=canvas.getContext("2d"); for(var i=0; i<TG.length;i++) draw( tangram[i],context)} function draw( plece, cxt){ cxt.beginPath(); cxt.moveTo(plece.p[0].x,plece.p[0].y); for(var i=1;i<plece.p.length;i++) cxt.lineTo(plece.p[i].x,plece.p[i].y); cxt.closePath(); cxt.fillStyle=plece.color; cxt.fill(); }查看全部
-
var _canvas = document.grtElementById("canvas"); _canvas.width:1024; _canvas.height:500; var conttext = _canvas.getContext(2d);查看全部
-
var _canvas = getElementById('canvas'); var cont查看全部
-
计算第(i,j)个圆的圆心位置.查看全部
-
render a digit查看全部
-
context.moveTo(100,100)和context.lineTo(700,700)是意图绘制一条从(100,100)到(700,700)的直线,而stroke是绘制操作查看全部
-
如果用户浏览器支持canvas,canvas标签中的内容将被忽视。如果浏览器不支持canvas,则会显示标签中的内容查看全部
-
js方法设置canvas尺寸:获取canvas元素的ID,并用myCanvas变量接收。再通过myCanvas.width和myCanvas.height的方式来设置canvas的尺寸查看全部
-
待学习查看全部
举报
0/150
提交
取消