微信小程序开发 专题
专题目录
您的位置:微信小程序开发 > 微信小程序开发专题 > 微信小程序save/restore(保存和恢复绘图上下文)
微信小程序save/restore(保存和恢复绘图上下文)
作者:--    发布时间:2019-11-20


定义

保存当前的绘图上下文。

restore


定义

恢复之前保存的绘图上下文。

例子

const ctx = wx.createcanvascontext('mycanvas')

// save the default fill style
ctx.save() 
ctx.setfillstyle('red')
ctx.fillrect(10, 10, 150, 100)

// restore to the previous saved state
ctx.restore()
ctx.fillrect(50, 50, 150, 100)

ctx.draw()


网站声明:
本站部分内容来自网络,如您发现本站内容
侵害到您的利益,请联系本站管理员处理。
联系站长
373515719@qq.com
关于本站:
编程参考手册