您使用UIImagePickerController
直接:
UIImagePickerController *thePicker = [[UIImagePickerController alloc] init];
thePicker.delegate = thePickerDelegate;
thePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
//Here you would present thePicker modally, and release it after this
//It will be deallocated when you remove it from screen
[anotherViewController presentModalViewController: thePicker animated:NO];
[thePicker release];
在thePickerDelegate
,實現
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo;
的image
是你拍的照片,和你願意,你可以操縱它。如果你想UIImagePickerController
拍攝一張照片後dissapear,這是你會觸發這個動作,並通過調用
[thePicker dismissModalViewControllerAnimated: NO];
http://stackoverflow.com/從屏幕上刪除它,在上面介紹,該模式的情況下問題/ 74113/access-the-camera-with-iphone-sdk – 2009-11-17 19:53:26
我無法理解,爲什麼你不能只使用UIImagePicker?製作照片的標準控制。 – Morion 2009-11-17 19:53:57