<feImage>
<feImage> SVG 滤镜基元从外部源获取图像数据并提供像素数据作为输出(这意味着如果外部源是 SVG 图像,则会将其栅格化)。
使用上下文
| 类别 | 滤镜基元元素 |
|---|---|
| 允许的内容 | 任意数量的以下元素,以任意顺序<animate>、<animateTransform>、<set> |
属性
DOM 接口
此元素实现 SVGFEImageElement 接口。
示例
SVG
html
<svg
viewBox="0 0 200 200"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="200"
height="200">
<defs>
<filter id="image">
<feImage href="mdn_logo_only_color.png" />
</filter>
</defs>
<rect x="10%" y="10%" width="80%" height="80%" style="filter:url(#image);" />
</svg>
结果
规范
| 规范 |
|---|
| 滤镜效果模块级别 1 # feImageElement |
浏览器兼容性
BCD 表格仅在浏览器中加载
另请参阅
- SVG 滤镜基元属性
flood-color属性flood-opacity属性<filter><animate><animateTransform><set><feBlend><feColorMatrix><feComponentTransfer><feComposite><feConvolveMatrix><feDiffuseLighting><feDisplacementMap><feFlood><feGaussianBlur><feMerge><feMorphology><feOffset><feSpecularLighting><feTile><feTurbulence>- SVG 教程:滤镜效果