摘要:
一、canvas是基于状态的绘图环境 1、canvas是基于状态的绘制 context.moveTo(100,100); context.lineTo(700,700); context.lineWidth=10; //直线的宽度状态设置 context.strokeStyle="#058"; // 阅读全文
摘要:
图形变换。 一、画一片星空 先画一片canvas.width宽canvas.height高的黑色星空,再画200个随机位置,随机大小,随机旋转角度的星星。 window.onload=function(){ var canvas=document.getElementById("canvas"); 阅读全文
摘要:
一、线条的帽子lineCap 取值:butt(默认值),round圆头,square方头 var canvas=document.getElementById("canvas"); canvas.width=800; canvas.height=800; var context=canvas.get 阅读全文