简体   繁体   English

如何从Camera ios拍摄几张图像

[英]How to take several images from Camera ios

I`m making one implementation for take photo from camera and select photo from library. 我正在做一个实现,可以从相机拍摄照片并从图库中选择照片。

For take photos from library i`m using ELCImagePickerController and setting the images in a scrollview. 要使用ELCImagePickerController从库i`m 拍照并在滚动视图中设置图像。

What i want to do is take several images from Camera and setting this on the same scroll view. 我要做的是从相机拍摄几张图像,并将其设置在同一滚动视图上。

Current my implementation is: 当前我的实现是:

- (IBAction)takePhoto:(UIButton *)sender {

        UIImagePickerController *cameraPicker = [[UIImagePickerController alloc] init];
        cameraPicker.delegate = self;
        cameraPicker.allowsEditing = YES;
        cameraPicker.sourceType = UIImagePickerControllerSourceTypeCamera;

        [self presentViewController:cameraPicker animated:YES completion:NULL];
}

- (void)imagePickerController:(UIImagePickerController *)photoPicker didFinishPickingMediaWithInfo:(NSDictionary *)info {

        [photoPicker dismissViewControllerAnimated:YES completion:NULL];
        UIImage *image=[info objectForKey:UIImagePickerControllerEditedImage];
        UIImageView *imageview = [[UIImageView alloc] initWithImage:image];
        [imageview setContentMode:UIViewContentModeScaleAspectFit];

        [self.scrollView addSubview:imageview];
        [self dismissModalViewControllerAnimated:YES];
}

With this i just can take one photo per time and when i set this again it replace the other one. 有了这个,我每次只能拍摄一张照片,而当我再次设置它时,它将替换另一张照片。 How can i take serveral? 我该如何服用Serveral? and how i supose do that? 我该怎么做呢?

First,I want say Thanks to Fahri Azimov, him comment on my Question but he dont asnwer it. 首先,我要说感谢法赫里·阿齐莫夫(Fahri Azimov),他对我的问题发表了评论,但他没有回答。 I found the solution on CocoaControls . 我在CocoaControls上找到了解决方案。

There I found one Application doing what I was looking for. 在那里,我发现一个应用程序正在执行我想要的操作。

RPMultipleImagePicker RPMultipleImagePicker

What I had to do Add the controllers,models and resources from RPMultipleImagePicker. 我必须做什么从RPMultipleImagePicker添加控制器,模型和资源。 Import it on my Controller. 将其导入我的控制器。 Then change some things in Image Picker for add in my on ScrollView. 然后在Image Picker中更改一些内容以添加到ScrollView中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM