String HTML5画布彩色文本
如何在画布中为文本添加颜色。当我尝试fillStyle时,文本一直是黑色的。您确实需要设置fillStyle,然后调用fill()String HTML5画布彩色文本,string,html,colors,canvas,String,Html,Colors,Canvas,如何在画布中为文本添加颜色。当我尝试fillStyle时,文本一直是黑色的。您确实需要设置fillStyle,然后调用fill() 您确实需要设置fillStyle,然后调用fill() 谢谢,我在发布问题后发现了。这是我问题的最终结果:谢谢,我在发布问题后发现了。以下是我问题的最终结果: ctx.strokeStyle = 'red'; ctx.stroke(); ctx.fillStyle= 'blue'; ctx.fill();
您确实需要设置fillStyle,然后调用fill()
谢谢,我在发布问题后发现了。这是我问题的最终结果:谢谢,我在发布问题后发现了。以下是我问题的最终结果:
ctx.strokeStyle = 'red';
ctx.stroke();
ctx.fillStyle= 'blue';
ctx.fill();