我是 iOS 新手。我想通过从用户那里绘制来裁剪图像。我在谷歌上搜索了一天,但没有得到结果。 谢谢您的回答。
最佳答案
试试这段代码
UIImagePickerController *picker=[[UIImagePickerController alloc] init];
picker.delegate = self;
[picker setAllowsEditing:YES];
picker.sourceType=UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:nil];
然后你可以从
中获取裁剪图像 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info valueForKey:UIImagePickerControllerEditedImage];
picker dismissViewControllerAnimated:YES completion:^{}];
}
关于ios - Objective-C 通过绘图裁剪图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32499876/