AwayJS Screen Capture

Software: Away3D 4.x

GrokDD, Newbie
Posted: 17 July 2014 05:52 AM   Total Posts: 28

I’m trying to grab the bitmap data of the webGL canvas element.
I’ve tried many ways for 4 hours and gave up and am now asking for advice.

The closest I’ve gotten is using something similar to

  function convertCanvasToImage(canvas) {
      var image = new Image();
      image.src = canvas.toDataURL();
      return image; 
  };

which returns 64x data, but is blank.

to which the netziens recommend setting the preserveDrawingBuffer to true.
Like so:
  awayCanvas.getContext(“experimental-webgl”, {preserveDrawingBuffer: true});

However I don’t know if this actually does anything.

Nonetheless, I’m just trying to get a screen shot of the Away View on the webGL canvas, to duplicate into a separate image tag.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X