Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 994837 of ImageBitmap

  • Revision slug: Web/API/ImageBitmap
  • Revision title: ImageBitmap
  • Revision id: 994837
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment Add close method (bug 1172796)

Revision Content

{{APIRef("Canvas API")}}

The ImageBitmap 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. ImageBitmap provides an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL.

Properties

{{domxref("ImageBitmap.height")}} {{readonlyInline}}
Is an unsigned long representing the height, in CSS pixels, of the ImageData.
{{domxref("ImageBitmap.width")}} {{readonlyInline}}
Is an unsigned long representing the width, in CSS pixels, of the ImageData.

Methods

{{domxref("ImageBitmap.close()")}}

Disposes of all graphical resources associated with this ImageBitmap.

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', "webappapis.html#imagebitmap", "ImageBitmap")}} {{Spec2('HTML WHATWG')}}  

Browser compatibility

{{ CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop(42)}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
close() {{CompatNo}} {{CompatGeckoDesktop(46)}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile(42)}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}}
close() {{CompatNo}} {{CompatNo}} {{CompatGeckoDesktop(46)}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}

See also

  • {{domxref("ImageBitmapFactories.createImageBitmap()")}}
  • {{domxref("CanvasRenderingContext2D.drawImage()")}}
  • {{domxref("WebGLRenderingContext.texImage2D()")}}
  • {{domxref("OffScreenCanvas.transferToImageBitmap")}}

Revision Source

<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>Methods</h2>

<dl>
 <dt>{{domxref("ImageBitmap.close()")}}</dt>
 <dd>
 <p>Disposes of all graphical resources associated with this <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>&nbsp;</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{ CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop(42)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
  <tr>
   <td><code>close()</code></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop(46)}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Android Webview</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoMobile(42)}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td><code>close()</code></td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop(46)}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<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>
Revert to this revision