view.renderer.queueSnapshot away3D 4.1

Software: Away3D 4.x

Joan Toh, Newbie
Posted: 03 July 2014 03:13 PM   Total Posts: 1

Hi, Can anyone explain how to use view.render.queueSnapshot to save view3d screen to a bitmap. I get it. I have to use this function but what i dont understand is how to save and use it? eg. export to jpg. Thanks in advance.

   

Avatar
theMightyAtom, Sr. Member
Posted: 06 July 2014 08:44 PM   Total Posts: 669   [ # 1 ]

Something like this…

private function takeSnapShot(e:MouseEvent):void 
  {
   
   
var bmd:BitmapData = new BitmapData(_view.width,  _view.heightfalse0xFFFFFF);
   
_view.renderer.queueSnapshot(bmd);
   
_view.render();
   var 
pje:JPGEncoder = new JPGEncoder(100);
   var 
img:ByteArray pje.encode(bmd);
   
   var 
fileReference:FileReference=new FileReference();
   
fileReference.save(img".jpg"); 
   
  

Good Luck!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X