Flash Screenshot

We are trying to send an image of a large SWF file to the server so that it can be mailed and we are having problems with the transfer times.

The SWF is around 900px x 600px and capped at AS2, so we used this Bitmap Exporter class. We tried to use several different ways of transferring data; base10, base36 and base128, but none of them will send the file in any form in a timely manner.

We are now dealing with 60-120 seconds per image, which is unacceptable.

Does anyone have any advice on working with this class or friend to send big raster data to server with flash?

Thank you for your time.

+1


source to share


5 answers


The reason you take so long to load is because the image is barely compressed (or not at all depending on how the class is implemented). 900 by 600 pixels at 16 bps (or whatever flash is currently using) is roughly 1.5 MB of raw data.

I doubt there are any useful compression libraries for AS2, but there might be a possible way.



The easiest way to reduce the client-side image size is to lower the resolution. Are you using full resolution when it reaches the server? If this is not possible, it is possible.

(I suppose you know it would be easier using AS3, then you could compress the whole image as a jpeg client without much effort, but I think the rest of your AS2 application makes this somewhat moot point)

+1


source


You can also try using amfphp as it allows binary serialization when sending data to the server.



0


source


You probably want to implement a simple RLE algorithm in AS2, if it doesn't already exist, to compress the bitmap. Assuming you have good vector color elements, RLE should provide decent compression.

0


source


There are a couple of good JPEG compression classes for as3, one of which I use googles: http://code.google.com/p/as3corelib/

You might be able to port this to as2 ...

0


source


Just fly fast and link - http://www.gskinner.com/blog/archives/2006/03/saving_bitmapda.html

edit - this might be helpful too! http://www.5etdemi.com/blog/archives/2006/10/the-ultimate-as2-bitmapdata-saving-solution/

Grant Skinner suggests dumping the image data to a smaller color palette and then some compression at runtime (it leans towards compressing UTF-8 strings and then handles the image conversion elsewhere, server I think)

UltimateBrent's link to the JPEG compression library sounds like a good, if not technically difficult idea.

Color depth is a problem? lossy compression?

Can you send a bunch of variables to the server, recreate the image of the locally running swf and then export it there? or are there too many variables (eg in a painting type program)? For example, if you make your own avatar, you can turn the settings into XML and generate an image from the site on the server. Dunno!

0


source







All Articles