A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Hi-Res Zooming

  1. #1
    Junior Member
    Join Date
    Aug 2000
    Posts
    12

    Hi-Res Zooming

    I'm hoping this is a simple question, so here goes . . .

    I have a hi-res aerial and would like to zoom in on a particular part of the aerial. Sounds simple, right? Well, when I zoom in the graphic loses it hi-res and everything gets pixelated. What am I not doing correctly?

    I have tried doing a frame by frame with 12 different aerials and it's too choppy. Any suggestions?

    HawksQuest
    ...a right-brained in a left-brained world.

  2. #2
    It's a long way to the middle launchpad67's Avatar
    Join Date
    Oct 2004
    Location
    Prescott, Arizona
    Posts
    1,387
    How 'high-res' is the image? What resolution is it? What is the file size?

  3. #3
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    Zooming in or scaling a high res image will produce a pixelated effect if scaled to far. Your options are to use a lower resolution image or find a point where the scale doesn't effect the image in a noticeable way. I wrote an autozoom function that might be useful for something like this. It zooms in to any mouse clicked position and has 3 predefined scale limits.

    code:

    /*
    Auto Zoom Function
    T. Norman
    http://ntdesigns.net
    */
    myZoom = function (myDepth) {
    if (myDepth == "deep") {
    myDepth = 4;
    } else if (myDepth == "medium") {
    myDepth = 8;
    } else if (myDepth == "light") {
    // default
    myDepth = 12;
    }
    trace(myDepth);
    _root.onMouseDown = function() {
    if (k>0) {
    return;
    }
    zoom = true;
    dir == 1 ? (dir=-1) : (dir=1);
    if (dir == 1) {
    pt = {x:_root._xmouse, y:_root._ymouse};
    }
    }
    this.onEnterFrame = function() {
    if (!zoom) {
    return;
    }
    _root._xscale += dir*k*50/myDepth;
    _root._yscale += dir*k*50/myDepth;
    var pt2 = {x:pt.x, y:pt.y};
    _root.localToGlobal(pt2);
    _root._x -= (pt2.x-pt.x);
    _root._y -= (pt2.y-pt.y);
    k++;
    if (k == 8) {
    zoom = false;
    k = 0;
    }
    }
    }
    myZoom("medium");


  4. #4
    Member
    Join Date
    May 2002
    Posts
    42
    Hi,

    I hate to butt into a thread, but I'm hoping that NDT (or anyone who can help) sees this. The zoom code is absolutely great, but of course I have a problem with it.

    I'm trying to apply it to a movieclip (instance name, map) instead of to my entire movie. I've tried putting the code in different places, and I've tried changing some of the code; but it either zooms the entire movie or it doesn't work at all. Is there a way to direct it to a specific movieclip?

    Thanks a bunch,
    Debbie

    Note to HawksQuest:
    I've been doing something similar to your resolution problem. It may not be the best way, but here's what I did. I created the image, outside of Flash, half of the maximum size that I wanted to zoom it to. I scaled the image to the desired size when I placed it into my movie, then I was able to zoom it to twice the size of the original without losing much clarity. Don't laugh, it was the only way I could get good results.
    Debbie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center