We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to use the WebGLExtract class to create screenshots, but am getting a black image instead (of the correct dimensions).
var sourceCanvas = renderer.extract.canvas(); var sourceContext = sourceCanvas.getContext('2d'); var extractCanvas = document.createElement('canvas'); var extractContext = extractCanvas.getContext('2d'); var imageData = sourceContext.getImageData(x, y, width, height); extractCanvas.width = width; extractCanvas.height = height; extractContext.putImageData(imageData, 0, 0); return extractCanvas.toDataURL();
I've also tried just accessing sourceCanvas.toDataURL() directly, but with the same results. Any chance I've forgotten something obvious?
sourceCanvas.toDataURL()
The text was updated successfully, but these errors were encountered:
It can happen in some cases, but if you pass your stage there, and it gets imageData just after rendering it - I'm sure it'll work.
renderer.extract.canvas(stage);
And if you are friday-night-drunk and forgot where is your stage
renderer.extract.canvas(renderer._lastObjectRendered);
Sorry, something went wrong.
Hey @noffle is this still an issue?
@ivanpopelyshev That did it! Thank you so much. ❤️ And thanks @englercj for poking me on this.
@ivanpopelyshev Спасибо тебе огромное!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
I'm trying to use the WebGLExtract class to create screenshots, but am getting a black image instead (of the correct dimensions).
I've also tried just accessing
sourceCanvas.toDataURL()
directly, but with the same results. Any chance I've forgotten something obvious?The text was updated successfully, but these errors were encountered: