【发布时间】:2013-01-23 10:04:46
【问题描述】:
我正在使用UIImagePickerView 控制器从我的应用程序中的 iPhone 默认相机拍照。完成此过程需要很长时间。
-(IBAction)takePhoto:(id)sender
{
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera])
{
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imgPicker animated:YES];
}
}
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *pickedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
[self dismissModalViewControllerAnimated:YES];
NSData *imageData = UIImagePNGRepresentation(pickedImage);
path = [SAVEDIMAGE_DIR stringByAppendingPathComponent:@"image.png"];
[imageData writeToFile:path atomically:YES];
[tableview reloadData];
}
【问题讨论】:
-
你需要在这里粘贴你的代码
-
@flink 我添加了我的代码请检查它
标签: iphone xcode uiimagepickercontroller