In my app I increase an images size, and decrease it, using the following code:
float xx = image.frame.origin.x;
float yy = image.frame.origin.y;
image.frame = CGRectMake(xx,yy, width*0.98, height*0.98);
float xx = image.frame.origin.x;
float yy = image.frame.origin.y;
image.frame = CGRectMake(xx,yy, width*1.02, height*1.02);
What this code does is it scales the image from an origin of the top left, therefore as the scale is done, the image focal point moves off the screen, increase by increase, decrease by decrease.
So the problem I have with this, is that the focal point of my image is not the top left, but in a specific point on the image. When my image is scaled it scales using the top left as its origin. How can I either change the point at which the image scales from, or preferably, mathematically calculate a translation of the new shape, so that the new focal points position would be moved to where the unscaled images focal point would have been? Thanks