Skip to content

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'图片格式
qualitynumber0.95JPEG 质量(0-1)

Demo

Released under the MIT License.