ByteArray to BitmapData
The Below code demonstrates the conversion of ByteArray to BitmapData. In the below case, SWF is loaded and converted into BitmapData
private function swfLoad_complete(evt:Event):void {
byteArrayToBitmapData(swf.content.loaderInfo.bytes);
}
private function byteArrayToBitmapData(ba:ByteArray):void {
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, getBitmapData);
loader.loadBytes(ba);
}
private function getBitmapData(e:Event):void {
var content:* = loader.content;
var BMPData:BitmapData = new BitmapData(content.width,content.height);
var UIMatrix:Matrix = new Matrix();
BMPData.draw(content, UIMatrix);
}

can you help to decompile an swf file?
The “loader.loadBytes” was very helpful. Did not think of that function.
Thanks!
Is it possible to load .tif images.. If so How can I achieve to load tif images?
How about the other way around? BitmapData to ByteArray? I tried getPixels… but the bytearray is empty.
Nm, figured it out.
var rec:Rectangle = new Rectangle(0, 0, imgWidth, imgHeight);
var ba:ByteArray = bmpData.getPixels(rec);
tanks
obrigado
gracias
for help
from Brasil