OffscreenCanvas
Functional description: Off-screen canvas instance, available through wx.createOffscreenCanvas create.
Properties
Properties Type Description width number Canvas width. height number Canvas height.
* Method set
createImage
TIP
The API usage is as follows: Image OffscreenCanvas.createImage()
- Functional description: Create an image object. Supports use in 2D Canvas and WebGL Canvas, but does not support mixing 2D and WebGL methods.
- Return value: Image Note that it is not allowed to mix image objects created by webgl and 2d canvases. When using, please try to use canvas's own createImage to create image objects.
getContext
TIP
The API usage is as follows: RenderingContext OffscreenCanvas.getContext(string contextType)
Functional description: This method returns the drawing context of the OffscreenCanvas
Parameters and descriptions: string contextType, Drawing context type, which needs to be consistent with the type passed in when createOffscreenCanvas.
Legal value Description webgl webgl type context 2d 2d type context