2015-04-23 61 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)