Creating our own crop rect in camera overlay

…衆ロ難τιáo~ 提交于 2019-11-30 10:27:31

You have to Implement your own CropRect. First set the

[picker setAllowsEditing:NO];

Then in didFinishPickingMediaWithInfo delegate Push your own CropRect View

CustomImageEditor *custom = [[CustomImageEditor alloc] initWithNibName:@"CustomImageEditor" bundle:nil];
[picker pushViewController:custom animated:YES];
[custom release];

while Pushing view pass the image to the Custom View like this

 UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
 custom.pickedImage = image;

In that customView you crop the image.

For croping the image try like this..

CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], cropRect);
UIImage *image = [UIImage imageWithCGImage:imageRef];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!