Hi,
I am having problems dealing with the alpha channel of an image. Basically I do this:
- I load an image (.png) and keep it in a bitmap:
…
var loadedBitmap:Bitmap
…
function completeLoad (evt:Event):void{
var loaderInfo:LoaderInfo = evt.target as LoaderInfo
loadedBitmap = loaderInfo.content as Bitmap;
};
- Then I use copyPixels to take a portion of the image which has alpha channel
var bm:Bitmap;
bmd1.copyPixels(loadedBitmap.bitmapData, new Rectangle(0,0,64,64), new Point(0,0),null,null,true);
bm = new Bitmap(bmd1);
shapeContainer1.addChild(bm);
addChild(shapeContainer1);
If I render the whole image contained into loadedBitmap , I can see the transparent background.
var temp:MovieClip = new MovieClip ();
temp.addChild(loadedBitmap);
addChild(temp);
But using above procedure the background is shown black.
Any help?
Thanks in advance