Canvas shadowBlur eigenschap
Definitie en gebruik
shadowBlur
Instellen of retourneren van de vaagheid van de schaduw.
Voorbeeld
Teken een blauwe rechthoek met een zwart schaduw, de vaagheid is 20:
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);
语法
context.shadowBlur=number;
Attribute value
Value | Description |
---|---|
number | The blur level of the shadow. |
Technical details
Default value: | #000000 |
---|
Browser support
The numbers in the table indicate the first browser version that fully supports this property.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
4.0 | 9.0 | 3.6 | 4.0 | 10.1 |
Note:Internet Explorer 8 and earlier versions do not support the <canvas> element.