4 Replies Latest reply on May 21, 2007 12:16 PM by kglad

    compressing bitmap data?

    zibber Level 1
      hi does anyone know if it is possible to compress bitmap data before sending to server? its going to cause massive issues:| thanks in advance
        • 1. Re: compressing bitmap data?
          Rothrock Level 5
          I'm sure its possible. But my guess is your real question is, "Is there an easy way to compress bitmap data?" :)

          A quick check of the BitmapData class help files shows me nothing that is obvious to help with compression.

          But a quick google search lead me to this page:


          It seems make a byteArray() compress and send. Hmmmm…

          Post back and let us know what you work out. I would be interested.
          • 2. Re: compressing bitmap data?
            kglad Adobe Community Professional & MVP
            with as 3 you can use the compress() method of the bytearray class and you can use the getPixels() method of the bitmapdata class to generate a bytearray.

            with as2 you cannot compress before sending. however, i've sent 400x400 bitmaps without more than 10 second delays and i used an animation to entertain and inform that the send was in-progress.
            • 3. Re: compressing bitmap data?
              zibber Level 1

              Yes I looked at the compress function, but it's still a bit wieghty in regards to file size. However, worked out a nother solution by trawling the web. There is a class that encodes bitmap data as jpg which results in much smaller files. I just need to pull out a stripped down version of the files im working on and i will provide a link on this thread for anyone who is interested. hopefully tommorow


              • 4. Re: compressing bitmap data?
                kglad Adobe Community Professional & MVP
                you can also check mario klingeman's (quasimondo) bitmapexporter class.