/**
 * 图形绘制阴影
 */
function initDemo6() {
    var canvas = document.getElementById("demo6");
    if (!canvas) return;
    var context = canvas.getContext("2d");
    context.fillStyle = "#02c9e5";
    context.shadowOffsetX = 10; // 阴影横向位移
    context.shadowOffsetY = 10; // 阴影纵向位移
    context.shadowColor = 'rgba(100, 100, 100, 0.5)'; // 阴影颜色
    context.shadowBlur = 7.5; // 阴影模糊范围
    context.fillRect(25, 25, 300, 300);
}

 

相关文章:

  • 2021-12-20
  • 2021-09-01
  • 2022-02-15
  • 2022-01-02
  • 2021-08-26
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2021-11-20
  • 2021-09-24
  • 2021-12-02
  • 2021-12-10
  • 2021-11-05
相关资源
相似解决方案