blob: 31a33886b9683f6cbdefd3f631a8c95eb6449820 (
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
65
|
---
title: ImageBitmap
slug: Web/API/ImageBitmap
tags:
- API
- Canvas
- Imagen de mapa de bits
- Referencia
translation_of: Web/API/ImageBitmap
---
<div>{{APIRef("Canvas API")}}</div>
<p>The <code><strong>ImageBitmap</strong></code> interface represents a bitmap image which can be drawn to a {{HTMLElement("canvas")}} without undue latency. It can be created from a variety of source objects using the {{domxref("ImageBitmapFactories.createImageBitmap", "createImageBitmap()")}} factory method. <code>ImageBitmap</code> provides an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL.</p>
<h2 id="Properties">Properties</h2>
<dl>
<dt>{{domxref("ImageBitmap.height")}} {{readonlyInline}}</dt>
<dd>Is an <code>unsigned</code> <code>long</code> representing the height, in CSS pixels, of the <code>ImageData</code>.</dd>
<dt>{{domxref("ImageBitmap.width")}} {{readonlyInline}}</dt>
<dd>Is an <code>unsigned</code> <code>long</code> representing the width, in CSS pixels, of the <code>ImageData</code>.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<dl>
<dt>{{domxref("ImageBitmap.close()")}}</dt>
<dd>
<p>Disposes of all graphical resources associated with an <code>ImageBitmap</code>.</p>
</dd>
</dl>
<h2 id="Specifications">Specifications</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="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.ImageBitmap")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li>{{domxref("ImageBitmapFactories.createImageBitmap()")}}</li>
<li>{{domxref("CanvasRenderingContext2D.drawImage()")}}</li>
<li>{{domxref("WebGLRenderingContext.texImage2D()")}}</li>
<li>{{domxref("OffScreenCanvas.transferToImageBitmap()")}}</li>
</ul>
|