2015-04-23 13 views

回答

5

我知道三种可能性。重要! For all these methods you must set preserveDrawingBuffer = true with webgl

要传输数据的URL

First one is high level method toDataURL and its origin is javascript

canvas.toDataURL(type, encoderOptions); 

如果你想要让你的客户做一些应用程序“屏幕截图”

Following two methods are low level and its origin is webgl.你可以用它们你可以用这个例子如果你想例如修改纹理或计算新纹理(阴影)。在当前帧缓冲器

12年5月14日回读像素

像素可被读回一个ArrayBufferView对象。

void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView? pixels)

5.14.8纹理对象

纹理对象的纹理操作提供存储和状态......

void texImage2D(GLenum target, GLint level, GLenum internalformat, GLint border, GLenum format, GLenum type, HTMLCanvasElement element)