HTML canvas shadowBlur property
Examples
Draw a red rectangle with a black shadow, blur Series 20:
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);
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 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