最新回答 / 慕粉215434359
//可以使用径向渐变,如使用线性渐变类似。关键就是径向渐变的坐标掌控。//我这坐标瞎写的,文字使用径向渐变有效果,但不明显。下面是代码var grd=context.createRadialGradient(400,100,50,400,100,100); grd.addColorStop(0.0,'red'); grd.addColorStop(1.0,'green'); context.fillStyle=grd; context.fillText('Hello World',200,200)...
2017-06-21
最新回答 / pencil115
应该这样:function drawRect(cxt,x,y,width,height,borderWidth,borderColor,fillColor){cxt.beginPath();cxt.moveTo(x,y);cxt.lineTo(x+width,y);cxt.lineTo(x+width,y+height);cxt.lineTo(x,y+height);cxt.closePath();cxt.lineWidth = borderWidth;cxt.fillStyle = fillColor;...
2017-04-07
最新回答 / 来自火星的花
五角星的半径在starPath里是不知道的,starPath只是画出一个标准五角星的样式,实际上你单独运行starPath是没有任何效果的,五角星的实际效果由scale(r,r)得出
2017-04-06