I am working on UIPinchGesture its working fine. I want to find the coordinate of image(x,y,width,height) when shrink and large every time. My code is:
-(IBAction) handlePinchGesture:(UIGestureRecognizer *) sender {
CGFloat factor = [(UIPinchGestureRecognizer *) sender scale];
CGPoint point = [sender locationInView:self.moveImageView];
NSLog(@"The Coordinate is:---> x = %f y = %f", point.x, point.y);
if (factor > 1) {
moveImageView.transform = CGAffineTransformMakeScale(lastScaleFactor + (factor-1), lastScaleFactor + (factor-1)); } else { moveImageView.transform = CGAffineTransformMakeScale(lastScaleFactor * factor, lastScaleFactor * factor);
}
if (sender.state == UIGestureRecognizerStateEnded){
if (factor > 1) {
lastScaleFactor += (factor-1);
} else {
lastScaleFactor *= factor;
}
}
}
moveImageView is the object of UIIMageView. The coordinate of x and y are printed, but we need also the height and width.
this work fine, i want to find the current coordinate (x,y,width,height) of image after a scaling(shrinking and large) of image. Any one help me plz asap.
Thanks in advanced:)