ScreenshotPlugin
截取当前渲染帧并下载为图片。
用法
ts
import { ScreenshotPlugin } from '@threeuse/core/plugins'
app.use(ScreenshotPlugin, { format: 'png' })
button.addEventListener('click', () => {
app.$screenshot.capture('my-scene.png')
})选项
| 选项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
format | 'png' | 'jpeg' | 'png' | 图片格式 |
quality | number | 0.95 | JPEG 质量(0-1) |