0 Replies Latest reply on Aug 30, 2008 11:20 AM by tony45371

    Thumbnails and memory issues

      I'm looking for advice on how to go about satisfying the following need. I'm very new to flex. We have a digital camera that takes a photo and places it in a directory that is being "watched." Wen the new image is detected it is loaded into a full size image and also into a smaller thumbnail in a list or tile list control.This works except there is a problem in that the memory usage increases drastically the more thumbnails there are. The full size images are placed in the thumbnails which are not freed up. This results in excessive memory usage.

      I've tried to use the jpeg encoder to write out a smaller jpg to user for the thumbnail. This works but again takes ~25 sec., too long for our app. I switched to png encoding and it only took about 5 sec. The png image did not load correctly though. I did the same thing for the png as I did for the jpg, specifying a path to the file. Are pngs supposed to load directly in image controls, list controls, or tile list controls or do I have to use some sort of custom loader?
      Is this the correct approach to solving my memory problem (using smaller file sizes) or is there something I'm missing. I would also like to avoid having to write the file to disk. I get a byte array from the encoder but I'm not clear on how to load the byte array into the list as an image.