iPhone定制相机叠加(加图像处理):操作方法 [英] iPhone custom camera overlay (plus image processing) : how-to
问题描述
今天从App Store购买的许多图片共享应用使用自定义相机,而不是由苹果提供的标准相机选择器。
Many image sharing apps available today from the App Store use a custom camera instead of the standard camera picker provided by Apple.
有没有人知道任何有关创建自定义摄像头的教程或提示?
Does anyone know any tutorials or tips for creating a custom camera?
推荐答案
是,从代码中创建UIImagePickerController,调整其属性,在其上添加覆盖,并与您的控制器,控制任何你想要的覆盖:自定义控件,覆盖图像等...
Yes, create a UIImagePickerController from code, adjust its properties, add an overlay onto it, and with you controller, control whatever you want on that overlay : custom controls, overlaying images, etc...
像这样:
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
是您必须编写的控制器
OverlayViewController
is the controller that you must write to control everything you add onto the overlay.
pickerReference
是您可以保留以向相机发送订单的财产。例如,您可以从来自放置在叠加层上的UIButton的IBAction调用以下内容:
pickerReference
is a property you can keep to send orders to the camera. For example, you could call the following from an IBAction coming from a UIButton placed onto the overlay :
[self.pickerReference takePicture];
这篇关于iPhone定制相机叠加(加图像处理):操作方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!