Posted By

visualadvance on 06/15/10


Tagged

bitmapData as3 getBounds


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

bobby
edsonpavoni
copic
tspitzr
mitien


AS3: SnapClip, Grab BitmapData Regardless of x, y


 / Published in: ActionScript 3
 

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

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: petedisco on June 30, 2011

nice one

You need to login to post a comment.