# RenderingContext OffscreenCanvas.getContext(string contextType)
Start from base library version 2.7.0. Please remaining backward compatible.
with Promise style call: Not supported
Mini Program plugin: Support, need to Mini Program base library version no less than 2.16.1
This method returns OffscreenCanvas Drawing context
# parameter
# string contextType
Drawing context type, which requires the createOffscreenCanvas Passed in when type Agreement
contextType Legal value
value | Introductions | Minimum version |
---|---|---|
webgl | Webgl type context | |
2d | 2d type context | 2.16.1 |
# Return value
# RenderingContext
Be careful not to mix webgl and 2d Drawing context, incoming contextType You have to work with wx.createOffscreenCanvas
Incoming type Same type.