最新回答 / 慕粉215434359
//可以使用徑向漸變,如使用線性漸變類似。關(guān)鍵就是徑向漸變的坐標(biāo)掌控。//我這坐標(biāo)瞎寫的,文字使用徑向漸變有效果,但不明顯。下面是代碼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
最新回答 / 小吵小鬧1217
給多個(gè)canvas標(biāo)簽,每個(gè)canvas給不同的id,根據(jù)id得到不同的canvas進(jìn)行操作,我覺得是這樣
2017-05-23
最新回答 / pencil115
應(yīng)該這樣: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
最新回答 / 來(lái)自火星的花
五角星的半徑在starPath里是不知道的,starPath只是畫出一個(gè)標(biāo)準(zhǔn)五角星的樣式,實(shí)際上你單獨(dú)運(yùn)行starPath是沒有任何效果的,五角星的實(shí)際效果由scale(r,r)得出
2017-04-06