代码:

 

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">

    <title>绘制阴影</title>
   <script>
       function init()  {
           var canvas=document.getElementById('canvas');
           var ctx=canvas.getContext("2d");
           ctx.shadowBlur=1.5;
           ctx.shadowColor="red";
           ctx.shadowOffsetX=5;
           ctx.shadowOffsetY=5;
           ctx.strokeStyle="blue";
           ctx.font=" italic 40px 宋体";
           ctx.strokeText("你好",200,200);


       }

   </script>

</head>
<body   onload="init();">
<canvas  ></canvas>
</body>
</html>

 

  效果:

HTML5  绘制阴影

 

2017-09-08  12:36:38 

 

相关文章:

  • 2021-08-14
  • 2022-12-23
  • 2021-12-02
  • 2022-02-18
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
猜你喜欢
  • 2022-01-28
  • 2022-02-15
  • 2021-12-09
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案