tencent cloud

All product documents
Tencent Cloud Super App as a Service
OffscreenCanvas
Last updated: 2024-11-21 18:41:53
OffscreenCanvas
Last updated: 2024-11-21 18:41:53
Function Description: Offscreen canvas instances can be created through wx.createOffscreenCanvas.

Attribute

Attributes
Types
Note
width
number
Canvas Width
height
number
Canvas Height

Method Set

createImage

The method is utilized as Image OffscreenCanvas.createImage()
Function Description: This creates an image object. It is compatible with both 2D Canvas and WebGL Canvas, however, it does not support the mixed use of 2D and WebGL methods.
Return Value: Image. Please note that the mixed use of image objects created by WebGL and 2D canvas is not permitted. When using, it is advisable to create image objects using the canvas's own createImage.

getContext

The method is utilized as RenderingContext OffscreenCanvas.getContext(string contextType)
Function Description: This method returns the drawing context of the OffscreenCanvas.
Parameters and Description: string contextType, the type of drawing context, which needs to be consistent with the type passed in when creating OffscreenCanvas.
Value
Note
webgl
WebGL type context
2d
2D type

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon