框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|
小程序 | Bug | createOffscreenCanvas, getContext | 微信iOS客户端 | 8.0.14 | 2.20.1 |
https://developers.weixin.qq.com/miniprogram/en/dev/api/canvas/wx.createOffscreenCanvas.html
Code:
// Create Off Screen 2D canvas Example
const canvas = wx.createOffscreenCanvas({type: '2d', width: 300, height: 150})
// Obtain context。 Note that this must be consistent with the type Agreement
const context = canvas.getContext('2d')
console.log("====");
console.log(context);
Output:
====
[sm]:61 undefined