Hello John,
the question is more related to Web development than to Embedded Wizard itself. From technical point of view, the WebGL context provides a method to read pixel data:
WebGLRenderingContext: readPixels() method
Assuming you plan to implement the read operation in Embedded Wizard project, following could be an example. Note the usage of native statement to envelope the JavaScript code. You should also note that the expected performance when reading data from the WebGL frame buffer can be disappointing. From our experience this interface is very slow.
$if $platform == *.WebGL.*
native
{
var gl = _app._Context;
var x = 0;
var y = 0;
var w = 1;
var h = 1;
var pixels = new Uint8Array( w * h * 4 );
gl.readPixels( x, y, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels );
console.log(pixels);
}
$endif
I hope it helps you further.
Best regards
Paul Banach