From 9d1dc7c3275cfa058fcf1988f5d34c884aa1fd5f Mon Sep 17 00:00:00 2001 From: khoaxuantu Date: Sat, 6 Jul 2024 00:07:30 +0700 Subject: [PATCH] test: screenshot --- static/js/screenshot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/js/screenshot.js b/static/js/screenshot.js index 9d67c41..2c1f578 100644 --- a/static/js/screenshot.js +++ b/static/js/screenshot.js @@ -27,6 +27,9 @@ function takeScreenshot() { canvas.getContext("2d").drawImage(video, drawLeft, drawTop, drawWidth, drawHeight); + const imgData = document.querySelector("a-scene").components.screenshot.getCanvas("perspective"); + canvas.getContext("2d").drawImage(imgData, 0, 0, drawWidth, drawHeight); + downloadScreenshot(canvas); video.play(); }