Here's another method that would allow you to pass in the whole UIComponent. Below is an example usage:
public function getUIComponentBitmapData( target:UIComponent, w:Number, h:Number ) : BitmapData { // scale down (or up) var scaleX:Number = w / target.width; var scaleY:Number = h / target.height; var m:Matrix = new Matrix(); m.scale(scaleX, scaleY); // get new bitmap data var bd:BitmapData = new BitmapData( w, h ); bd.draw( target, m ); bd.smoothing = true; // return the new bitmap data return bd; } Assume you have var originalImage:Image already set and you want to scale it down to 50x30: var newImage:Image = new Image(); newImage.source = getUIComponentBitmapData( originalImage, 50, 30 ); --- In flexcoders@yahoogroups.com, "stinasius" <stinas...@...> wrote: > > hi, please share the whole class please. >