0

Below Code works perfect but when pinching the image quality of image is not good.I checked many post but didn't find any solutions. Here I am not using the scrollview,want the solution without Scrollview.Help me.

Here is My Code :

  -(void)handlePinch:(UIPinchGestureRecognizer *)recognizer
   {

      UIGestureRecognizerState state = [recognizer state];

      CGFloat lastScale = [recognizer scale];


     if(state == UIGestureRecognizerStateBegan) {
    // Reset the last scale, necessary if there are multiple objects with different scales
        lastScale = [recognizer scale];floatValue];
     }

    if ([recognizer state] == UIGestureRecognizerStateBegan ||
        [recognizer state] == UIGestureRecognizerStateChanged) {


        CGAffineTransform transform = CGAffineTransformScale([[recognizer view] transform], [recognizer scale], [recognizer scale]);
        [recognizer view].transform = transform;

        recognizer.scale = 1.0;
    }

    if ([recognizer state] == UIGestureRecognizerStateEnded){

        lastScale = [recognizer scale];  // Store the previous scale factor for the next pinch gesture call

    }
 }

Please help me What, I have to change and where I am wrong.

iphone143
  • 15
  • 6

1 Answers1

0

The quality of the image will always get worse when zooming so you need a larger image if you want to keep the initial quality.

Christian
  • 382
  • 2
  • 11