Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'webgl' context still not working #2362

Closed
GarasChan opened this issue Sep 25, 2020 · 1 comment · Fixed by #2661
Closed

'webgl' context still not working #2362

GarasChan opened this issue Sep 25, 2020 · 1 comment · Fixed by #2661

Comments

@GarasChan
Copy link

GarasChan commented Sep 25, 2020

When I use html2canvas to parse canvas with 'webgl' or 'webgl2' context, the generated image is empty.

@fneumeyer
Copy link

It's possible that WebGL cleared your canvas' buffer before html2canvas can access it. Try to use the WebGLContextAttribute preserveDrawingBuffer = true. Note that you'll have to clear the buffer yourself before rendering the next frame then, if necessary.

Another way could be to take the screenshot exactly after rendering. So exactly after each other
renderToCanvas()
takeScreenshot()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants