var c2=new CanvasDraw(‘#canvas2‘,{ ‘attr‘:{‘width‘:400,‘height‘:400}, ‘lineWidth‘:4 , ‘scale‘:[0.7], //这里处理canvas 父级的缩放 ‘strokeStyle‘:‘red‘, ‘initFn‘:function(_this){}, ‘moveFn‘:function(_this){} }); //获取图像 ncreate[1].onclick=function(){ imgBox.src=c2.getImg(); } //清理滑板 nremove[1].onclick=function(){ c2.clearRect() }