Ok here is my situation. At work one of my data entry people has to upload and organize 1200-1500 pictures daily. This process was working well while she was on a windows xp machine. Now they have upgraded her to Windows 7, and the photo viewer opens a new window every time she clicks to look at a picture. This results in hundreds of windows open or lots of clicking to close them. Having been unable to find a suitable viewer to replace Photo Viewer, I decided to write one that works the way we need it to. I have everything working, but i want to make a few tweeks. Specifically, I want the boundaries of the image to stay outside of the window when moved. The code I have for moving the image is as follows.
Code: Select all
on mouseDown
set the lockcursor to false
set the cursor to hand
set the lockcursor to true
put the first item of the mouseLoc into tWOff
put the second item of the mouseLoc into tHOff
put the first item in the loc of img "Image" into tWI
put the second item in the loc of img "Image" into tHI
put tWI - tWOff into tWI
put tHi -tHOff into tHi
put true into tMouseD
end mouseDown
on mouseUp
set the lockcursor to false
set the cursor to arrow
set the lockcursor to true
put false into tMouseD
end mouseUp
on mouseMove tX tY
if tMouseD
then
set the loc of image "image" to (tWI + tX), (tHI + tY)
end If
end mouseMove
As you can see, when the image is larger than the stack, for instance when it is zoomed, the image can be dragged off the stack. How can I keep the left of the image to the left of the stack, top of the image above the top of the stack etc. without hindering motion in other directions and while preserving image aspect ratio.