Posted By

JaaQ on 03/18/11


Tagged

bitmapData as3 bitmap


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

shuchii
j4yc33


Bitmap Snapshots of DisplayObjects


 / Published in: ActionScript 3
 

  1. function snapClip( clip:DisplayObject ):BitmapData
  2. {
  3. var bounds:Rectangle = clip.getBounds( clip );
  4. var bitmap:BitmapData = new BitmapData( int( bounds.width + 0.5 ), int( bounds.height + 0.5 ), true, 0 );
  5. bitmap.draw( clip, new Matrix(1,0,0,1,-bounds.x,-bounds.y) );
  6. return bitmap;
  7. }

Report this snippet  

You need to login to post a comment.