How html5 uses canvas to draw text effects
This article mainly introduces html5 how to use canvas to draw text special effects, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
The code is as follows:
Var canvas=document.getElementById ("canvas"); var cxt=canvas.getContext ("2d"); cxt.font= "40px boldface"; / / draw the solid word cxt.fillStyle= "red"; / / fill the red cxt.fillText ("hello, Doctor Si", 10Power50); / / draw the hollow word cxt.strokeStyle= "red"; / / draw the red edge cxt.strokeText ("hello, Doctor Si", 10100)
Thank you for reading this article carefully. I hope the article "how html5 uses canvas to draw text special effects" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!