feImage

feImage 滤镜从外部来源取得图像数据,并提供像素数据作为输出(意味着如果外部来源是一个 SVG 图像,这个图像将被栅格化。)

用法

类别滤镜元素
允许的内容任意数量、任意顺序的下列元素:
<animate><animateTransform><set>

属性

全局属性

专有属性

DOM 接口

该元素实现了SVGFEImageElement (en-US)接口。

示例

SVG

html
<svg
  viewBox="0 0 200 200"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <filter id="image">
      <feImage xlink:href="/files/6457/mdn_logo_only_color.png" />
    </filter>
  </defs>

  <rect x="10%" y="10%" width="80%" height="80%" style="filter:url(#image);" />
</svg>

结果

规格

Specification
Filter Effects Module Level 1
# feImageElement

浏览器兼容性

BCD tables only load in the browser

参见