blob: 38f69210876a67b9f1cd5671978de948d16fe392 (
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
---
title: ImageBitmap
slug: Web/API/ImageBitmap
tags:
- API
- Canvas
- ImageBitmap
- Interface
- 绘图
translation_of: Web/API/ImageBitmap
---
<div>{{APIRef("Canvas API")}}</div>
<p><code><strong>ImageBitmap</strong></code> 接口表示能够被绘制到 {{HTMLElement("canvas")}} 上的位图图像,具有低延迟的特性。运用 {{domxref("ImageBitmapFactories.createImageBitmap", "createImageBitmap()")}} 工厂方法模式,它可以从多种源中生成。 <code>ImageBitmap</code>提供了一种异步且高资源利用率的方式来为WebGL的渲染准备基础结构。</p>
<h2 id="属性">属性</h2>
<dl>
<dt>{{domxref("ImageBitmap.height")}} {{readonlyInline}}</dt>
<dd>无符号长整型数值,表示ImageData的CSS像素单位的高度。</dd>
<dt>{{domxref("ImageBitmap.width")}} {{readonlyInline}}</dt>
<dd>无符号长整型数值, 表示ImageData的CSS像素单位的宽度。</dd>
</dl>
<h2 id="方法">方法</h2>
<dl>
<dt>{{domxref("ImageBitmap.close()")}}</dt>
<dd>
<p>释放ImageBitmap所相关联的所有图形资源。</p>
</dd>
</dl>
<h2 id="规范">规范</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', "webappapis.html#imagebitmap", "ImageBitmap")}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
{{Compat("api.ImageBitmap")}}
<h2 id="另见">另见</h2>
<ul>
<li>{{domxref("ImageBitmapFactories.createImageBitmap()")}}</li>
<li>{{domxref("CanvasRenderingContext2D.drawImage()")}}</li>
<li>{{domxref("WebGLRenderingContext.texImage2D()")}}</li>
<li>{{domxref("OffScreenCanvas.transferToImageBitmap()")}}</li>
</ul>
|