此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

CanvasPattern

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015年7月⁩.

备注: 此特性在 Web Worker 中可用。

CanvasPattern 接口表示一个不透明对象,描述了一个基于图像、画布或视频的模板,该模板通过 CanvasRenderingContext2D.createPattern() 方法创建。

它可以用作 fillStylestrokeStyle

实例属性

非透明对象,没有暴露的属性。

实例方法

没有继承来的方法。

CanvasPattern.setTransform()

应用 DOMMatrix 对模板做线性变换

规范

Specification
HTML
# canvaspattern

浏览器兼容性

参见