HTML 5 canvas shadowBlur 属性

实例

绘制一个带有黑色阴影的蓝色矩形,模糊级数是 20:

Your browser does not support the canvas tag.

JavaScript:

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.shadowBlur=20;
ctx.shadowColor="black";
ctx.fillStyle="blue";
ctx.fillRect(20,20,100,80);

亲自试一试

浏览器支持

Internet Explorer 9、Firefox、Opera、Chrome 以及 Safari 支持 shadowBlur 属性。

注释:Internet Explorer 8 以及更早的版本不支持 <canvas> 元素。

定义和用法

shadowBlur 属性设置或返回阴影的模糊级数。

默认值: #000000
JavaScript 语法: context.shadowBlur=number;

属性值

描述
number 阴影的模糊级数
系统帮助 | 给我留言 | 收藏本站
Copyright © 2005-2008 www.cnn84.com All Rights Reserved Ver:2.0
CNN84网是公益性便民网站,是为了给大家的日常生活查询及提供最快捷的出行指南