Latest web development tutorials

HTML canvas shadowBlur property

HTML canvas Reference Manual HTML canvas Reference Manual

Examples

Draw a red rectangle with a black shadow, blur Series 20:

YourbrowserdoesnotsupporttheHTML5canvastag.

JavaScript:

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

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 9, Firefox, Opera, Chrome and Safari support shadowBlur property.

Note: 8 and earlier versions of Internet Explorer do not support the <canvas> element.


Definition and Usage

shadowBlur property sets or returns the shadow blur series.

Defaults: 0
JavaScript syntax: context.shadowBlur = number;

Property Value

描述
number 阴影的模糊级数


HTML canvas Reference Manual HTML canvas Reference Manual