可能重复:
How do you create a custom camera view, instead of UIImagePickerViewController?
今天在apps提供的许多图像共享应用程序使用的是自定义相机,而不是苹果提供的标准相机选择器。
有谁知道制作自定义相机的教程或技巧吗?
发布于 2011-11-10 00:29:51
是的,从代码中创建一个UIImagePickerController,调整其属性,在其上添加一个覆盖,并与您的控制器一起控制该覆盖层上您想要的任何内容:自定义控件、叠加图像等.
这给出了这样的东西:
self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
self.picker.showsCameraControls = NO;
self.picker.navigationBarHidden = YES;
self.picker.toolbarHidden = YES;
self.picker.wantsFullScreenLayout = YES;
// Insert the overlay
self.overlay = [[OverlayViewController alloc] initWithNibName:@"Overlay" bundle:nil];
self.overlay.pickerReference = self.picker;
self.picker.cameraOverlayView = self.overlay.view;
self.picker.delegate = self.overlay;
[self presentModalViewController:self.picker animated:NO];OverlayViewController是一个控制器,您必须编写它来控制添加到覆盖层上的所有内容。
pickerReference是您可以保留的一个属性,用于向摄像机发送命令。例如,您可以从放置在覆盖层上的IBAction中调用来自UIButton的以下内容:
[self.pickerReference takePicture];发布于 2011-11-10 01:13:10
对于图像处理(关于我们在评论中的讨论),您可以查看以下内容:
http://code.google.com/p/simple-iphone-image-processing/
http://sourceforge.net/projects/photoshopframew/
https://github.com/esilverberg/ios-image-filters
http://developer.apple.com/library/ios/#samplecode/QuartzDemo/Introduction/Intro.html
http://cocoawithlove.com/2011/01/advanced-drawing-using-appkit.html
https://stackoverflow.com/questions/8073531
复制相似问题