This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The ImageBitmap.close() method disposes of all graphical resources associated with an ImageBitmap.
Syntax
void ImageBitmap.close()
Examples
var offscreen = new OffscreenCanvas(256, 256);
var gl = offscreen.getContext('webgl');
// ... some drawing using the gl context ...
var bitmap = offscreen.transferToImageBitmap();
// ImageBitmap { width: 256, height: 256 }
bitmap.close();
// ImageBitmap { width: 0, height: 0 } -- disposed
Specifications
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of 'close()' in that specification. |
Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
close | Chrome Full support 52 | Edge Full support 79 | Firefox Full support 46 | IE No support No | Opera Full support 37 | Safari No support No | WebView Android Full support 52 | Chrome Android Full support 52 | Firefox Android Full support 46 | Opera Android Full support 37 | Safari iOS No support No | Samsung Internet Android Full support 6.0 |
Legend
- Full support
- Full support
- No support
- No support
See also
- The interface defining this method,
ImageBitmap.
