6
除了第一個使用context.fillStyle
而後者使用context.strokeStyle
之外,context.fillText()
和context.strokeText()
之間是否有區別。任何他們沒有添加context.textStyle
屬性的原因?Canvas context.fillText()vs context.strokeText()
除了第一個使用context.fillStyle
而後者使用context.strokeStyle
之外,context.fillText()
和context.strokeText()
之間是否有區別。任何他們沒有添加context.textStyle
屬性的原因?Canvas context.fillText()vs context.strokeText()
是的,strokeText實際上描繪了字母的輪廓,而fillText填充了字母的內部。
ctx.fillStyle='red';
ctx.strokeStyle='green'
ctx.lineWidth=3;
ctx.font='90px verdana';
ctx.fillText('Q',50,150);
ctx.strokeText('Q',125,150);
ctx.fillText('Q',200,150);
ctx.strokeText('Q',200,150);
啊冷靜,我想我只是在創造文字太小,無法注意到strokeText財產。謝謝。 – Hoffmann 2014-09-12 21:29:34