WeChat アプレットの保存/復元 (描画コンテキストの保存と復元)
保存
定義
現在の描画コンテキストを保存します。
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()