小程序畫(huà)布恢復(fù)之前保存的繪圖上下文 CanvasContext.restore()
恢復(fù)之前保存的繪圖上下文。
小程序插件:支持
示例代碼
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()
作者:大學(xué)生新聞網(wǎng) 來(lái)源:大學(xué)生新聞網(wǎng)
發(fā)布時(shí)間:2025-04-12 閱讀: