微信小程序
Canvas.getContext
# RenderingContext Canvas.getContext(string contextType)
基础库 2.7.0 开始支持,低版本需做兼容处理。
小程序插件:支持
相关文档: 画布指南、canvas 组件介绍
# 功能描述
该方法返回 Canvas 的绘图上下文
# 参数
# string contextType
上下文类型
contextType 的合法值
# 返回值
# RenderingContext
支持获取 2D 和 WebGL 绘图上下文