Cropping a UIImage according to the viewport inside a UIScrollView
问题 I have a UIImageView (initialized with Aspect Fill) inside a UIScrollView. The user shall use that to resize and position a UIImage to his like, press a button and then exactly what he sees on screen would be sent to a server, only in the original image coordinates. In other words, the resulting image would be bigger than the image on screen. Here's the essential part of my code so far: // select the original CGFloat imageRatio = self.imageView.image.size.width / self.imageView.image.size