kernelMatrix
**kernelMatrix** 屬性定義構成 <feConvolveMatrix> 元素的核矩陣的數字列表。
值用空格和/或逗號分隔。列表中的條目數必須等於 <orderX> 乘以 <orderY>,如 order 屬性中定義的那樣。
您可以將此屬性與以下 SVG 元素一起使用
示例
html
<svg viewBox="0 0 420 200" xmlns="http://www.w3.org/2000/svg">
<filter id="convolveMatrix1" x="0" y="0" width="100%" height="100%">
<feConvolveMatrix kernelMatrix="1 1 0 0 0 0 0 0 -1" />
</filter>
<filter id="convolveMatrix2" x="0" y="0" width="100%" height="100%">
<feConvolveMatrix kernelMatrix="-1 0 0 0 0 0 0 0 1" />
</filter>
<image
href="mdn_logo_only_color.png"
width="200"
height="200"
style="filter:url(#convolveMatrix1);" />
<image
href="mdn_logo_only_color.png"
width="200"
height="200"
style="filter:url(#convolveMatrix2); transform:translateX(220px);" />
</svg>
使用說明
規範
| 規範 |
|---|
| 濾鏡效果模組級別 1 # element-attrdef-feconvolvematrix-kernelmatrix |
瀏覽器相容性
BCD 表格僅在啟用 JavaScript 的瀏覽器中載入。