Auto Import Same Image on stage
Crop ( draw the crop area ..runtime ) n Resize ( save resized size )
Save .png temporary
Auto Import Same PNG on stage
Is it possible? Has anyone done this? Can anyone do this ?
AS3 – BitmapData class and Adobe’s PNG writing class. To save the image you’ll need PHP to do the actual saving and for the uploading process though, but I’ve done similar things with Flash, yes.
You can upload an image, then either wait for it to finish and read it off the server or, if flash 10 is an option, read it strait from disk.
You can then encode it to png using the png encoding class from as3corelib ( http://code.google.com/p/as3corelib/ ), save it to the server, then read it back.
thanks so much guys..
i have done with flie reference as2 the upload and import..
problem is drawing crop region and save png ??? any assistance would be highly appreciated….
drawing the crop region needs to use the BitmapData class.
saving the png means converting the BitmapData you end up with to a ByteArray in png format (using the class geoken was pointing to) and sending the ByteArray to a PHP file to save. I don’t know of any AS2 way to accomplish the saving PNG part unless you do most of it on the PHP side of things.
yeah here’s where AS3 becomes a god I think I remember something like this on the actionscript.org forums a few years ago, some clever fool managed a work around, hard work though…
Why not use AS3 , porting what you’ve got wont be too hard…
i am unable to find any tutorials using as3 and php ??? and whoever is spending time to pst in here..thanks a ton..u never know…which idea will click
you can do it with as2 and php I have done something simmilar before
I’ve seen it too, the PHP does the majority of the work though, cuz AS2 is kinda lackluster for that kind of stuff, working with binary, ect.
- Most Wanted Bounty Winner
- Sold between 250 000 and 1 000 000 dollars
- Has been a member for 5-6 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Won a Competition
- Bought between 100 and 499 items
- Exclusive Author
- Referred between 200 and 499 users
Sephirot has a cool tutorial on how to do that, and you can also download the whole script(php+fla+as). Link here : http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php
Another cool script that exists on the web(but free only for personal use) is Quasimodo’s BitmapExporter. This is the best app that exports image files from flash i think. I used it a while ago and it worked perfect. Download link : http://www.quasimondo.com/scrapyard/BitmapExporter_v22.zip
With any of those classes you simply have to define a rectangle box for the newly cropped image. So use the BitmapData class to crop your uploaded image, then export it to an image using on of those classes