Take a screenshot of game canvas area

Hello Everyone!

It’s my first post and I am so proud to take part to the Gdevelop community.
I am making a html5 game, and my question is?
[size=120]Is there way to take a screenshot to the game canvas area and save this in a image file?[/size]

I tried via javascript code:

var imageFile = document.getElementsByTagName("canvas")[0].toDataURL('image/png'); document.write('<img src="' + imageFile + '"/>')

This code take a screenshot, but appear only a black image.
Any suggestion?

Thanks :slight_smile: