blob: cfdd69291626252fdbf20ceedfcf91f2b0183077 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
---
title: CanvasPattern
slug: Web/API/CanvasPattern
translation_of: Web/API/CanvasPattern
---
<div>
{{APIRef("Canvas")}}</div>
<p><code><strong>CanvasPattern</strong></code> 接口表示描述一个模板(基于image, canvas或video)的不透明对象,通过 {{domxref("CanvasRenderingContext2D.createPattern()")}} 方法创建.</p>
<h2 id="属性">属性</h2>
<p><em>非透明对象,没有暴露出属性</em></p>
<h2 id="方法">方法</h2>
<p><em>没有继承来的方法</em></p>
<dl>
<dt>
{{domxref("CanvasPattern.setTransform()")}} {{experimental_inline}}</dt>
<dd>
应用 {{domxref("SVGMatrix")}} 对模板做线性变换</dd>
</dl>
<h2 id="Specifications" name="Specifications">标准</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">标准</th>
<th scope="col">状态</th>
<th scope="col">备注</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', "the-canvas-element.html#canvaspattern", "CanvasPattern")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>新增 <code>setTransform()</code> 方法</td>
</tr>
<tr>
<td>{{SpecName('HTML Canvas 2D Context W3C', '#canvaspattern', 'CanvasPattern')}}</td>
<td>{{Spec2('HTML Canvas 2D Context W3C')}}</td>
<td>初始定义</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<div>
{{Compat("api.CanvasPattern")}}
<h2 id="查看相关">查看相关</h2>
<ul>
<li>{{domxref("CanvasRenderingContext2D.createPattern()")}}</li>
<li>{{HTMLElement("canvas")}} 元素及和canvas相关接口 {{domxref("HTMLCanvasElement")}}</li>
</ul>
|