HTML canvas shadowBlur attribute

Definition and Usage

shadowBlur Sets or returns the blur level of the shadow.

Example

Draw a blue rectangle with black shadow, blur level is 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);

Kokeile itse

Syntaksi

context.shadowBlur=number;

Ominaisuusarvo

Arvo Kuvaus
number Varjon sumeusaste

Tekninen tarkistus

Oletusarvo: #000000

Selaimen tuki

Taulukossa olevat numerot osoittavat ensimmäisen täysin tukevan selaimen version.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
4.0 9.0 3.6 4.0 10.1

Huomautus:Internet Explorer 8 ja aikaisemmat versiot eivät tue <canvas>-elementtiä.