Hi, I’m trying to zoom an image around the current Mouse point (sort of like google craps…err, maps). So when you have the mouse in the bottom right corner and zoom in (mouse wheel scroll up) it zooms around that point, but then you can move the mouse to the top left corner and continue to zoom in and it will zoom around the new point in the top left corner. I have this working (in the attached code … I guess you have to be logged in to see the code and image) but the problem I have is with zooming back out. Unlike Google maps I don’t want to zoom out past the boundary of the map - I want the map to remain in the view. Right now, if you zoom in the bottom right corner and then move the mouse to the top left corner and start to zoom back out, eventually you will see the corner of the map but in reality I don’t want to be able to zoom out past the map extents (…the code eventually snaps back but that’s not a solution I want).
sorry for the poor code, but I tried a bunch of things like retrieving the rectangle that represents the current zoomed in portion of the map and using that to determine when to force the zoom to scale of 1.0, etc, etc…there must be a more elegant way to do this. I don’t want to use scroll bars and I don’t want to zoom out and see the map edges.