I have 2 SWFLoaders like so:
<mx:SWFLoader width="10" height="10" complete="imageLoaded()" id="ldr_src" source="img.jpg" scaleContent="true"/>
<mx:SWFLoader id="ldr_target" scaleContent="true"/>
private function imageLoaded():void{
var bm:Bitmap = new Bitmap(ImageSnapshot.captureBitmapData(ldr_src);
ldr_target.source = bm;
}
Everything here works as expected, except one little small thing:
I load an image of size 100×100 in ldr_src(which is 10×10). The bitmap is copied in ldr_target, but with unexpected results. I would’ve thought a 10×10 size of the loaded image would be copied. Instead the bitmap from (0,0) to (10,10) of the loaded image is copied to the target.
No matter what the actual size of the image, how do I copy the bitmapData of the size which is scaled down by the swfLoader?
Pass the
image.contentintoImageSnapshot.captureBitmapData, then make sure the width/height of the ldr_target is set equal to the src:Lance