This strikes me as a pure math problem. I have an image I can zoom into and out of. That works fine, but what I'm trying to do now is keep the point the same. I have an image P. I have a rectangular viewing area V. I have a zoom factor Z. I know the location L within picture P in which the upper left corner V starts drawing. I have a point in V where the changes start S. When I change Z I want the location of S to remain the same. That is, the part of the picture P at the prior zoom at point S should still be under point S after the change in Z. In order to do that, I need to change L to move it up and to the left when Z increases, down to the right when Z decreases. I do have access to the old value of Z when I'm doing this. I figure it has to at least deal with the difference between L and S and the change in Z... but right now I'm a touch stumped by this.
↧