3 Replies Latest reply on Sep 24, 2008 7:52 AM by kglad

    Zoom into bitmap and quality

    saraband38
      Hello everybody,

      I'm working on an interactive map and I need to allow the users to zoom into the map to see more details. My problem is that my map background is a jpeg so when I zoom into it the pixels appear. The solution I found was to import my jpeg as big as it can be zoomed and show it unzoomed but it makes a very big file.

      So I was wondering, is there any solution to make flash render the image everytime it's zoomed as if it recalculates the quality of the image ? (for exemple, google maps does it, when you zoom the image is crispy and it gets better after some small loading time)

      So if anyone has a suggestion of the direction I would need tot ake in order to make a not too big file with good quality it would be nice, I could work on it but I'm a bit short on ideas about it right now.

      Thanks in advance
        • 1. Re: Zoom into bitmap and quality
          Venian
          I don't know the basics of the Google system, which is not flash. But they could have more images cached for every zoom, because you can see that they have several fixed zoom levels, so they could produces images for every zoom level.

          In flash you can't recalculate an image, because the image is bitmap is not vector so it can't be recalculated. One way to do it is to have images for every zoom level, and obviously have some defined zoom levels.

          Hope that helps.
          • 2. Re: Zoom into bitmap and quality
            saraband38 Level 1
            Hi Venian,

            thanks for the tip, I was thinking about that but wasn't sure how to do it.

            So let me know if I'm wrong but for exemple I would have to say that everytime the user zooms in or out the object's scale gets +5 or +10 for exemple and when it's zoomed it loads the image corresponding to the zoom level ?
            • 3. Re: Zoom into bitmap and quality
              kglad Adobe Community Professional & MVP
              you can use the bitmapdata class to smooth bitmaps when scaling. the draw() method allows bitmap smoothing when using a source and destination bitmap. (so, you'll need to create a destination bitmap).

              or, you could load your bitmap into a target movieclip and enable the forceSmoothing property of your target movielcip.