zooming from a particular point

Posted by Chandan Shetty SP on Stack Overflow See other posts from Stack Overflow or by Chandan Shetty SP
Published on 2010-12-21T05:26:59Z Indexed on 2010/12/21 5:31 UTC
Read the original article Hit count: 230

Filed under:
|
|

I am using this code to zoom from a particular point

CGPoint getCenterPointForRect(CGRect inRect)
{
    CGRect screenRect = [[UIScreen mainScreen] bounds];
    return CGPointMake((screenRect.size.height-inRect.origin.x)/2,(screenRect.size.width-inRect.origin.y)/2);
}

-(void) startAnimation
{
    CGPoint centerPoint = getCenterPointForRect(self.view.frame);
    self.view.transform = CGAffineTransformMakeTranslation(centerPoint.x, centerPoint.y);
    self.view.transform = CGAffineTransformScale( self.view.transform , 0.001, 0.001);
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:kTransitionDuration];
    self.view.transform = CGAffineTransformIdentity;
    [UIView commitAnimations];
}

Its not working. What is the correct way to do zooming from a particular point.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch