简体   繁体   中英

A-Frame: Programmatically taking panoramic screenshots

Following docs here for panoramic screen shots https://aframe.io/blog/screenshot/ they have hot keys for users taking screen shots, is there a way for me to generate a panoramic screenshot without user input?

as well as choosing to save it (server side).

You can take screen captures programatically using the methods outlined in the following documentation:https://aframe.io/docs/0.8.0/components/screenshot.html#methods

To take a screenshot programatically and get a canvas, call getCanvas():

// `screenshot.projection` property can be `equirectangular` or `perspective`.
document.querySelector('a-scene').components.screenshot.getCanvas('equirectangular');

To take a screenshot programmatically and automatically save the file, call capture():

document.querySelector('a-scene').components.screenshot.capture('perspective');

服务器端,如果没有用户交互,您将需要一些更重的东西,例如https://github.com/AdaRoseCannon/ff-a-frame-snap使用 Selenium 打开 Firefox 并通过 Node.js 截取等距柱状屏幕截图。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM