可能重复:
How do you create a custom camera view, instead of UIImagePickerViewController?iPhone定制的摄像头覆盖(+图像处理):如何对
许多图片分享应用程序可从App Store今天使用自定义的相机,而不是Apple提供的标准摄像头选择器。
有没有人知道任何教程或提示创建自定义相机?
可能重复:
How do you create a custom camera view, instead of UIImagePickerViewController?iPhone定制的摄像头覆盖(+图像处理):如何对
许多图片分享应用程序可从App Store今天使用自定义的相机,而不是Apple提供的标准摄像头选择器。
有没有人知道任何教程或提示创建自定义相机?
是,创建从代码的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
是一个属性,你可以继续发送订单到相机。例如,你可以调用从一个UIButton未来的IBAction为放置在覆盖以下内容:
[self.pickerReference takePicture];
对于图像处理(对我们的意见讨论),你可以在此看一看:
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
伟大的奥利弗!谢谢! –
谢谢你的回答。我已经理解,但只有一个问题:我怎样才能制作一个按钮,当它按下时,它会停止从相机捕捉图像? (用几句话说,我怎么能实现一个'拍照'按钮,谢谢大家 –
@FredCollins:在覆盖层上放一个按钮,用IBAction将它连接到IBAction调用[self.pickerReference takePicture];(检查在苹果文档中的方法名称,我认为这是一个) – Oliver
感谢奥利弗!你还有任何想法如何实现效果适用于图像?如果当我尝试实现这一点,我会遇到一些麻烦我我会写在这里,你很亲切 –