Ios 我使用自定义视图预览UIImagePicker预览,如何从结果图像中提取与预览相同的区域?

Ios 我使用自定义视图预览UIImagePicker预览,如何从结果图像中提取与预览相同的区域?,ios,objective-c,cocoa-touch,Ios,Objective C,Cocoa Touch,在我的视图中,我有一个用于预览相机的ui视图。它比常规预览视图(128x128)小得多。我初始化UIImagePickerController如下: self.picker = [[UIImagePickerController alloc] init]; self.picker.delegate = self; self.picker.sourceType = UIImagePickerControllerSourceTypeCamera; self.picker.cameraDevice =

在我的视图中,我有一个用于预览相机的
ui视图
。它比常规预览视图(128x128)小得多。我初始化
UIImagePickerController
如下:

self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
self.picker.showsCameraControls = NO;

self.picker.view.frame = self.profilePictureView.frame;
然后我使用
[v addSubview:self.picker.view]
在我的自定义视图中显示相机的预览。到目前为止,这一切都如期进行,我看到相机预览的一部分在该视图中与我的自定义视图重叠(基本上用我的自定义视图遮住预览)。
现在,我正在尝试将我的
ui视图中显示的内容转换为
ui图像
(生成一个128x128图像)。我尝试使用委托方法,但我只从那里的相机获得全尺寸图像。我也试着从视图中截图,但我迷路了

如何创建一个
ui图像
,其内容与渲染相机预览时使用的视图完全相同,包括大小、偏移和比率