Imaging Lingo issues- PLEASE HELP

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default Imaging Lingo issues- PLEASE HELP

    Hi,
    Im having a major problem getting some simple features ready with imaging
    lingo, and I need help!!
    1st feature:
    Select an X-ray, it pops up into a small part of the stage, and the user
    should be able to zoom in and out and pan around the x-ray image. The xray,
    when first selected, should "best fit" the small area it is show in,
    maintaining its aspect ratio. From there the user can zoom in and out. It
    MUST be centered when first displayed, yet if the user pans the image around
    it MUST zoom in/ out from where the user has panned to. I cant find any
    samples of this!
    My simple exercise in zooming is here:
    [url]http://www3.sympatico.ca/jacobfarber/zoom/zoom.dcr[/url]
    I know its nothing, but I never used imaging lingo before. The simplistic
    code is:

    on startMovie
    zoomRect = member("image").rect
    zoomImage = member("image")
    blank = member("blank")
    proxy = member("proxy")
    end

    on zoomIn
    lOffset = ((zoomRect.width * 1.1) / 2) - (proxy.width / 2) -- center
    horizontally the copied image
    tOffset = ((zoomRect.height * 1.1) / 2) - (proxy.height / 2)
    member("proxy").image.copyPixels(blank.image, proxy.rect, blank.rect) --
    clear bitmap before copying
    member("proxy").image.copyPixels(zoomImage.image, ((zoomRect * 1.1) -
    lOffset), (zoomImage.rect))
    zoomRect = zoomRect * 1.1 -- set the new rect so it remains constant
    updateStage
    end

    on zoomOut
    lOffset = ((zoomRect.width / 1.1) / 2) - (proxy.width / 2) -- center
    horizontally the copied image
    member("proxy").image.copyPixels(blank.image, proxy.rect, blank.rect)--
    clear bitmap before copying
    member("proxy").image.copyPixels(zoomImage.image, ((zoomRect / 1.1) -
    lOffset), zoomImage.rect)
    zoomRect = zoomRect / 1.1 -- set the new rect so it remains constant
    updateStage
    end

    I can centre this horizontally, but not vertically (ive tried changing
    things around but the whole thing goes aout of whack.
    Anything would be a lifesaver!
    Jacob


    Jacob Farber Guest

  2. Similar Questions and Discussions

    1. Imaging Lingo with Director 3D
      http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=268&threadid=940489&enterthread=y from earlier this week.
    2. imaging lingo
      hey, Is there a way to resize a member's image without it getting distorted. Director is a vector based program, so when you resize a sprite(with...
    3. imaging lingo (zoom + pan)
      Hi, I need to make a zoom & pan feature for a small part of the stage. There are a few problems: 1) I can make the image expand and contract, but...
    4. text over bmp w/ imaging lingo
      I'm using imaging lingo to compose some text over a bitmap. The result i scored was quite good --until i set the composed member on stage. The...
    5. Imaging lingo challenge...
      Okay, I was asking this in the Photoshop newsgroups, but not getting much luck, so I wonder if there's a coding-approach I can take to this. I have...
  3. #2

    Default Re: Imaging Lingo issues- PLEASE HELP

    Looking at one line of your code, looks like you should be doing rect
    math to add in your offset, for example

    rect(0, 0, 10, 20) + rect(100, 200, 100, 200)

    shifts the initial rect 100 H, 200 V


    Here's the revised line of code

    member("proxy").image.copyPixels(zoomImage.image, ((zoomRect * 1.1) -
    rect(lOffset,tOffset,lOffset,tOffset), (zoomImage.rect))


    Here's a link to a magnifier with zoom I did, (sorry no free source)


    [url]http://galileo.spaceports.com/~mediatip/shocksamples/Mag_glass_Shock_Demo[/url]
    ..htm
    JB Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139