非常教程

SVG参考手册

分类 | Elements

fegaussianblur

<feGaussianBlur>SVG过滤器原语由在规定的数额模糊输入图像stdDeviation,它定义了钟形曲线。

用法上下文

分类

过滤基元

允许的内容

以任意顺序包含以下任意数量的元素:<animate>,<set>

属性

全局属性

  • Core attributes
  • Presentation attributes
  • Filter primitive attributes
  • class
  • style

具体属性

  • in
  • stdDeviation
  • edgeMode

DOM接口

这个元素实现了SVGFEGaussianBlurElement接口。

Simple example

SVG

<svg width="230" height="120"
 xmlns="http://www.w3.org/2000/svg"
 xmlns:xlink="http://www.w3.org/1999/xlink">

  <filter id="blurMe">
    <feGaussianBlur in="SourceGraphic" stdDeviation="5" />
  </filter>

  <circle cx="60"  cy="60" r="50" fill="green" />

  <circle cx="170" cy="60" r="50" fill="green"
          filter="url(#blurMe)" />
</svg>

结果

Screenshot

Live sample

后方阴影例子

SVG

<svg width="120" height="120"
 xmlns="http://www.w3.org/2000/svg"
 xmlns:xlink="http://www.w3.org/1999/xlink">

  <filter id="dropShadow">
    <feGaussianBlur in="SourceAlpha" stdDeviation="3" />
    <feOffset dx="2" dy="4" />
    <feMerge>
        <feMergeNode />
        <feMergeNode in="SourceGraphic" />
    </feMerge>
  </filter>

  <circle cx="60"  cy="60" r="50" fill="green"
          filter="url(#dropShadow)" />
</svg>

结果

Screenshot

Live sample

产品规格

Specification

Status

Comment

Filter Effects Module Level 1The definition of '<feGaussianBlur>' in that specification.

Working Draft

Added edgeMode attribute

Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<feGaussianBlur>' in that specification.

Recommendation

Initial definition

浏览器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

?

(Yes)

4.0 (2.0)

?

9.0

9.1.1

Feature

Android

Edge

Firefox Mobile (Gecko)

IE Phone

Opera Mobile

Safari Mobile

Basic support

?

(Yes)

?

?

?

?

SVG

可缩放矢量图形是基于可扩展标记语言(标准通用标记语言的子集),用于描述二维矢量图形的一种图形格式。它由万维网联盟制定,是一个开放标准。