Get the App
SLTechnology News&Howtos  ›  Development  › 

How html5 uses canvas to draw text effects

Shulou Source: shulou.com Published: 2022-06-03 14:56:21 10月25日 Update

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!

Tags: Articles text special effects doctor red code value interest at the same time more friends knowledge editing industry information information channels channels boldface reference learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft Docker Shulou Information Shulou Tech Info