# CanvasContext.save()

保存绘图上下文。

# 示例代码

const ctx = qa.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()
1
2
3
4
5
6
7
8
9
10
11
12

在线客服