iPhone custom camera overlay (plus image processing) : how-to [duplicate]

南楼画角 提交于 2019-12-03 01:32:36

问题


Possible Duplicate:
How do you create a custom camera view, instead of UIImagePickerViewController?

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?


回答1:


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...

That gives something like this :

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 is the controller that you must write to control everything you add onto the overlay.

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];



回答2:


For image processing (regarding our discuss in the comments), you could take a look at this :

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/iphone-custom-camera-overlay-plus-image-processing-how-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!