rnc-archive / react-native-webgl

DEPRECATED: use expo-gl – Implements WebGL for react-native
295 stars 73 forks source link

canvas.toDataURL() equivalent? #73

Closed frading closed 4 years ago

frading commented 6 years ago

Hello,

I am trying to find a way to make a screenshot of the WebGL component. Currently, when using three.js on web, I can do

renderer.domElement.toDataURL()

But here .domElement doesn't return anything, which probably makes sense since it is specific to three.js. But I am now wondering how something similar could be done here.

So does anyone know if there is a way to get the pixel data of the webgl canvas the image is drawn onto? (It could be the dataUrl or any equivalent)