ImageBitmap
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Canvas API")}}{{AvailableInWorkers}}
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("Window.createImageBitmap()")}} or {{domxref("WorkerGlobalScope.createImageBitmap()")}} factory method. ImageBitmap provides an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL.
ImageBitmap is a transferable object.
Instance properties
- {{domxref("ImageBitmap.height")}} {{ReadOnlyInline}}
- : An
unsigned longrepresenting the height, in CSS pixels, of theImageBitmap. - {{domxref("ImageBitmap.width")}} {{ReadOnlyInline}}
- : An
unsigned longrepresenting the width, in CSS pixels, of theImageBitmap.
Instance methods
- {{domxref("ImageBitmap.close()")}}
- : Disposes of all graphical resources associated with an
ImageBitmap.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{domxref("Window.createImageBitmap")}}
- {{domxref("WorkerGlobalScope.createImageBitmap")}}
- {{domxref("CanvasRenderingContext2D.drawImage()")}}
- {{domxref("WebGLRenderingContext.texImage2D()")}}
- {{domxref("OffscreenCanvas.transferToImageBitmap()")}}