UIImagePickerControllerCropRect
で指定された値を使用してUIImagePickerControllerOriginalImage
を手動でクロップできます。
未テストの迅速かつ汚い例:あなたは、編集後にその画像の品質を低下させる問題を解決する方法を
static UIImage *my_croppedImage(UIImage *image, CGRect cropRect)
{
UIGraphicsBeginImageContext(cropRect.size);
[image drawAtPoint:CGPointMake(-cropRect.origin.x, -cropRect.origin.y)];
UIImage *cropped = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return cropped;
}
- (void) imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// …
UIImage *originalImage = info[UIImagePickerControllerOriginalImage];
CGRect cropRect = [info[UIImagePickerControllerCropRect] CGRectValue];
UIImage *croppedImage = my_croppedImage(originalImage, cropRect);
// …
}
見つかりましたか? – Sawsan