0

My App will shows an image which the user is allowed to resize height OR width separately. Currently i have an UIImageView showing the image and allowed multi-touch (pretend to be pinch gesture).

How can I transform the image width/height without changing the UIImageView frame?

Original ImagetouchMove to change heighttouchMove to change width

The problem is don't know how to change the image size without touching the UIImageView.frame

- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {

    if (pinch == widthChange) {
       // Calculate moving distance and become image size change factor
       // Perform Image size change
    } else if (pinch == heightChange) {

    }
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    //Mark the touch points for compare
}
Peter Hornsby
  • 4,208
  • 1
  • 25
  • 44
Kevin
  • 313
  • 1
  • 4
  • 12
  • 1
    Maybe better you put the UIImageView into a UIView, change the UIImageView and the UIView keeps original as you want. – Haroldo Gondim Dec 20 '15 at 11:25
  • 1
    Are you asking how to resize image? (See http://stackoverflow.com/a/10491692/1271826.) Or are you asking how to properly use gestures to capture what you want to size it to? Or are you asking how to have two separate gestures that size width and height separately? My only advice or resizing is that you probably want to always resize the original image (be wary about resizing an image that you've already resized, especially if doing this repeatedly). – Rob Dec 20 '15 at 11:32
  • I would try to redraw the image into a uiview based on the gestures!!! and finally load the image into the image view – Teja Nandamuri Dec 20 '15 at 13:34
  • Thank you very much all, will try to add imageview on top of uiview – Kevin Dec 21 '15 at 01:24

0 Answers0