# SaveToAlbum - 保存到相册
# 示例代码
import {
WxCanvas2d,
SaveToAlbum
} from 'wx-canvas-2d'
WxCanvas2d.use(SaveToAlbum)
const canvas = new WxCanvas2d()
// canvas.create()
// ...
// canvas.draw()
// ...
// 保存到相册
canvas.save({
destWidth: 600,
destHeight: 900
}).then(res => {
console.log(res)
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22