Resize a BitmapData object maintaining transparency straight from loaderInfo

How to resize a BitmapData ?

I’ve got this right after loading an image:

var bitmapdata1:BitmapData = Bitmap(_bitmaploader.contentLoaderInfo.content).bitmapData;

I want to create a new BitmapData called “temp”:

var temp:BitmapData = new BitmapData(_custom_resize_width, _custom_resize_height);

which should become a resized version of the " bitmapdata1 "

how do I do that ?

my attempt worked but produced white background:

var mat:Matrix = new Matrix();
mat.scale(_custom_resize_width / bitmapdata1.width, _custom_resize_height / bitmapdata1.height);
temp.draw(Bitmap(loader_content), mat)

I’d like to maintain the transparency!

any help would be greatly appreciated :sigh: