Can someone point me in the right direction. I've been searching around for this, but can't seem to find a clear answer. I have a UIScrollview thats 300x300 pixels. Inside that I have an UIImageView. The idea is to allow a user to grab a photo from their library, then pinch and zoom it within the 300x300 scrollview. Then save the view port as a new photo.
So far I have this...
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
UIImageView *insideImgView = [[UIImageView alloc] initWithImage:image];
scroller.contentSize = CGSizeMake(image.size.width, image.size.height);
scroller.maximumZoomScale = 4.0;
scroller.minimumZoomScale = 0.0;
scroller.clipsToBounds = YES;
scroller.delegate = self;
[self setSendImage:insideImgView];
[scroller addSubview:insideImgView];
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return sendImage;
}
This works fine. I can pull the image in and pinch and zoom. But now how do i get the zoom and coordinates to slice up the photo when the they are done?