CanvasPattern

CanvasPattern interface represents an opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() 方法。

It can be used as a fillStyle or strokeStyle .

特性

As an opaque object, this has no exposed property.

方法

There are no inherited method.

CanvasPattern.setTransform()
Applies an SVGMatrix or DOMMatrix representing a linear transform to the pattern.

规范

规范 状态 Comment
HTML Living Standard
The definition of 'CanvasPattern' in that specification.
实时标准 添加 setTransform() method in v5.

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
CanvasPattern Chrome 4 Edge 12 Firefox 3.6 IE 9 Opera 9 Safari 3.1 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 3.2 Samsung Internet Android 1.0
setTransform Chrome 68 Edge 79 Firefox 33 IE 不支持 No Opera 9 Safari 3.1 WebView Android 68 Chrome Android 68 Firefox Android 33 Opera Android 10.1 Safari iOS 11 Samsung Internet Android 10.0

图例

完整支持
完整支持
不支持
不支持

另请参阅