- ·上一篇文章:微信小程序API 绘图中使用setGlobalAlpha设置全局画笔透明度
- ·下一篇文章:微信小程序API 绘图·draw(进行绘图)
微信小程序save/restore(保存和恢复绘图上下文)
由 ?﹏???ζ???﹏﹏? 创建,youj 最后一次修改 2016-12-26 绘图接口和方法canvasContext.save定义保存当前的绘图上下文。restore定义恢复之前保存的绘图上下文。例子const ctx = wx.createCanvasContext('myCanvas')// save the default fill stylectx.save() ctx.setFillStyle('red')ctx.fillRect(10, 10, 150, 100)// restore to the previous saved statectx.restore()ctx.fillRect(50, 50, 150, 100)ctx.draw()绘图接口和方法
微信小程序save/restore(保存和恢复绘图上下文)