Greetings to all!
Today, I am proud of this very interesting article.
Not that the other ones are not interesting but this one beats them all from my point of view.
Have you ever thought on how to extract an image of format .png from a SWF?
With Actionscript 2.0, I personally had done it for an application using the BitmapData class and the library GD of PHP. It was certainly not very performing but it was the only way to do it at the time.
With Actionscript 3.0, we have the ByteArray class available that allows us to script a BitmapData into a ByteArray.
As my knowledge of binary programming are not sufficient to realise all of it on my own, I found on the web a script from Adobe, which scripts a BitmapData and returns a ByteArray.
I then realised that the ByteArray was not ready to be passed to a server side script and so I asked help to a friend of mine, an engineer named Daniele Lazzara of OrigamiStudio.it with a real virtue in informatics and a big passion for Flash. He used a codification created by Steve Webster & dynamicflash.com to convert the ByteArray to a String and implemented a PHP script to complete the job.
Finally, I implemented a call to the PHP script from Flash and…it works wonderfully!







{ 2 comments… read them below or add one }
Can anyone tell me if it is possible to save everything that is on the stage as a PNG and not only the lines drawn??? If i add any shape on the stage it doesnt include it in the PNG, only the lines that was drawn???
Please help me
Hi Brian,
just use the draw() to stage.