最新回答 / 慕粉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