Skip to content

Commit

Permalink
test: screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
khoaxuantu committed Jul 5, 2024
1 parent c1263ee commit 9d1dc7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions static/js/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 9d1dc7c

Please sign in to comment.