@Generated(value="org.realityforge.webtack")
@JsType(isNative=true,
namespace="<global>",
name="OffscreenCanvas")
public class OffscreenCanvas
extends EventTarget
implements TexImageSource, GPUImageCopyExternalImageSource, Canvas, CanvasImageSource, Transferable
| Modifier and Type | Field and Description |
|---|---|
int |
height
The height property returns and sets the height of an OffscreenCanvas object.
|
@JsNullable EventHandler |
oncontextlost |
@JsNullable EventHandler |
oncontextrestored |
int |
width
The width property returns and sets the width of an OffscreenCanvas object.
|
| Constructor and Description |
|---|
OffscreenCanvas(int width,
int height)
The OffscreenCanvas() constructor returns a newly instantiated OffscreenCanvas object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContextlostListener(EventListener callback) |
void |
addContextlostListener(EventListener callback,
AddEventListenerOptions options) |
void |
addContextlostListener(EventListener callback,
boolean useCapture) |
void |
addContextrestoredListener(EventListener callback) |
void |
addContextrestoredListener(EventListener callback,
AddEventListenerOptions options) |
void |
addContextrestoredListener(EventListener callback,
boolean useCapture) |
@JsNonNull Promise<Blob> |
convertToBlob()
The OffscreenCanvas.convertToBlob()method creates a Blob object representing the image contained in the canvas.
|
@JsNonNull Promise<Blob> |
convertToBlob(ImageEncodeOptions options)
The OffscreenCanvas.convertToBlob()method creates a Blob object representing the image contained in the canvas.
|
@JsNullable OffscreenRenderingContext |
getContext(java.lang.String contextId)
The OffscreenCanvas.getContext() method returns a drawing context for an offscreen canvas, or null if the context identifier is not supported.
|
@JsNullable OffscreenRenderingContext |
getContext(java.lang.String contextId,
java.lang.Object options)
The OffscreenCanvas.getContext() method returns a drawing context for an offscreen canvas, or null if the context identifier is not supported.
|
void |
removeContextlostListener(EventListener callback) |
void |
removeContextlostListener(EventListener callback,
boolean useCapture) |
void |
removeContextlostListener(EventListener callback,
EventListenerOptions options) |
void |
removeContextrestoredListener(EventListener callback) |
void |
removeContextrestoredListener(EventListener callback,
boolean useCapture) |
void |
removeContextrestoredListener(EventListener callback,
EventListenerOptions options) |
@JsNonNull ImageBitmap |
transferToImageBitmap()
The OffscreenCanvas.transferToImageBitmap() method creates an ImageBitmap object from the most recently rendered image of the OffscreenCanvas.
|
addEventListener, addEventListener, addEventListener, dispatchEvent, removeEventListener, removeEventListener, removeEventListenerassign, create, create, defineProperties, defineProperty, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyDescriptor, getOwnPropertyDescriptors, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toString_, valueOf_, valuespublic int height
public @JsNullable EventHandler oncontextlost
public @JsNullable EventHandler oncontextrestored
public int width
public OffscreenCanvas(int width,
int height)
public @JsNonNull Promise<Blob> convertToBlob(@Nonnull ImageEncodeOptions options)
public @JsNonNull Promise<Blob> convertToBlob()
public @JsNullable OffscreenRenderingContext getContext(@OffscreenRenderingContextId @Nonnull java.lang.String contextId, @Nullable java.lang.Object options)
public @JsNullable OffscreenRenderingContext getContext(@OffscreenRenderingContextId @Nonnull java.lang.String contextId)
public @JsNonNull ImageBitmap transferToImageBitmap()
@JsOverlay
public final void addContextrestoredListener(@Nonnull
EventListener callback,
@Nonnull
AddEventListenerOptions options)
@JsOverlay
public final void addContextrestoredListener(@Nonnull
EventListener callback,
boolean useCapture)
@JsOverlay
public final void addContextrestoredListener(@Nonnull
EventListener callback)
@JsOverlay
public final void removeContextrestoredListener(@Nonnull
EventListener callback,
@Nonnull
EventListenerOptions options)
@JsOverlay
public final void removeContextrestoredListener(@Nonnull
EventListener callback,
boolean useCapture)
@JsOverlay
public final void removeContextrestoredListener(@Nonnull
EventListener callback)
@JsOverlay
public final void addContextlostListener(@Nonnull
EventListener callback,
@Nonnull
AddEventListenerOptions options)
@JsOverlay
public final void addContextlostListener(@Nonnull
EventListener callback,
boolean useCapture)
@JsOverlay
public final void addContextlostListener(@Nonnull
EventListener callback)
@JsOverlay
public final void removeContextlostListener(@Nonnull
EventListener callback,
@Nonnull
EventListenerOptions options)
@JsOverlay
public final void removeContextlostListener(@Nonnull
EventListener callback,
boolean useCapture)
@JsOverlay
public final void removeContextlostListener(@Nonnull
EventListener callback)