Hello,
The reason why is a bit convoluted, but I need to create a Bitmap (and
Image) from the result of an HTTPService invocation.
I am able to extract the "raw" image data from the event.result
property in the ResultEvent.RESULT listener, but then I am stuck.
I have two questions with respect to this.
First is what resultFormat I need to ask from the HTTPService (I now
use HTTPService.RESULT_FORMAT_TEXT) ?
Second is what after I get hold of the event.result
I tried a lot of things, like e.g.
var loader:Loader=new Loader();
var byteArray:ByteArray=new ByteArray();
byteArray.writeUTFBytes(result.event as String);
loader.loadBytes(byteArray);
var bitMap:Bitmap=Bitmap(loader.content);
But I typically get an error saying the data is not a valid bitmap.
I guess some cast and/or property is wrong but I have not been able to
sort it out just yet.
Any help much appreciated
Peter