1 person found this helpful
You can also use the below approach to capture the BitmapData of your moviclip(myClip).
So that you can make use of matrix class to resize the bitmap image.
var myClip:MovieClip = event.target as MovieClip;
var imageBitmapData:BitmapData = new BitmapData(myClip.width,myClip.height);
var pngEncode:PNGEncoder = new PNGEncoder();
var ba:ByteArray = pngEncode.encode(imageBitmapData);
var m:Matrix = new Matrix();
If this post answers your question or helps, please kindly mark it as such.
so hows the sleep going
This function will just take your display object and return what you want, pass the final width you need and it works out the scaling for you, you could make it more complex by comparing say width and final height to calculate 'best fit' but hey...
private function rescale(content:DisplayObject, width:int): BitmapData
var bd : BitmapData = new BitmapData(content.width*scale,content.height*scale);
var mt:Matrix=new Matrix();
hey guys... thanks you for the replys...
i tried both of your codes, and with a little modification to david's code it worked like a charm!!! thanks you soo much guys!!! really appretiate it!!
oh and the sleep sucks man... but thank god for the weekend soo exited to be passed out for 15 hours tommorow hehe