Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Jacob Farber #1
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
-
Imaging Lingo with Director 3D
http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=268&threadid=940489&enterthread=y from earlier this week. -
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... -
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... -
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... -
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... -
JB #2
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



Reply With Quote

