uiimagepickercontroller

how to capture camera with UIImagePickerController in swift?

淺唱寂寞╮ 提交于 2019-11-28 18:38:31
问题 I'm trying use UIImagePickerController in swift but isn't work... my ViewController: class ViewController: UIViewController { @IBOutlet var imag : UIView = nil @IBAction func capture(sender : UIButton) { println("Button capture") if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera) { var imag = UIImagePickerController() imag.delegate = self imag.sourceType = UIImagePickerControllerSourceType.Camera; imag.mediaTypes = kUTTypeImage imag.allowsEditing =

Add a circular cropping component for UIImagePicker?

走远了吗. 提交于 2019-11-28 18:29:10
I Have a circular framed UIImageView and I need to add a circular framed cropping tool for the UIImagePickerController , after the image is selected from a photo library. Very similar to Instagram's UIImagePicker's crop component. How do I add this type of component? UPDATE I've found this repo with a circular cropping tool https://github.com/ruslanskorb/RSKImageCropper but can someone guide me on to how to implement this cropping tool with the UIImagePickerController after the user selects a photo from the photo library? UPDATE I am getting the following message in my debugger : and the

camera overlay view - just for preview?

眉间皱痕 提交于 2019-11-28 17:18:54
I've noticed that in OS 3.1 you can add an overlay view to the image picker with cameraOverlayView However, I've also noticed that adding a view via this method also displays the view for the entire time the UIImagePicker is displayed, when I only want to show it during the preview stage. Is there a way to make this only happen during preview? I don't want it to be there during the open shutter animation, or the screen that asks whether you want to use the image or retake. I've figured out a way for you to achieve the desired result though it's a bit... not so standard. :) The idea is to

UIImagePickerController editing view circle overlay

徘徊边缘 提交于 2019-11-28 17:06:04
I've been able to get pretty far with what I've been wanting to accomplish, and that's to replicate iOS's built in circular photo cropper for the built in contacts app. However, I'm stuck at trying to get my CAShapeLayers made correctly. I'm trying to make a transparent 320 px diameter circle and the rest of the view filled with an 0.9 alpha black background. The circle and rectangle are in the right place, but, the circle is not completely transparent like I need it to be. I'm lost as to how to fix this. I appreciate your help! Code and screenshot: - (void)navigationController:

iPhone :How to get duration of video selected from library?

会有一股神秘感。 提交于 2019-11-28 16:50:58
问题 I am using UIImagePickerController to choose video file from library. And user can upload the video. Also I am using videoMaximumDuration property while user wants to capture video and upload it. I want to know that How can I get the duration of selected video file ? so that I can restrict the user to upload video that has duration more then 20 seconds. I am able to get some basic info about selected video by this code : - (void)imagePickerController:(UIImagePickerController *)picker

iPhone - UIImagePickerController -> save the image to app folder

跟風遠走 提交于 2019-11-28 16:15:01
I have an iPhone application using a UIImagePickerController . As sourceType I have UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerControllerSourceTypeCamera UIImagePickerControllerSourceTypeSavedPhotosAlbum so the user can make a photo or select one from the photo library from the photos or camera photos. The image will be displayed in a UIImageView. The image should be saved if the user closes the app. So for text fields, I use NSUserDefaults . I know, it is not a good way to save the image inside the NSUSerDefaults with NSData, so I want to save / copy the image to a folder

UIImagePickerController not presenting in iOS 8

大兔子大兔子 提交于 2019-11-28 15:52:39
Is anyone else having an issue with UIImagePickerController in iOS 8? The method below works perfectly well in iOS 7 on an iPad, but I get the following error when I run this in XCode 6 (Beta 3 or 4) when I try to present the picker (last line). If it matters, the selection of the sourceType is coming from an alertView that is presented in the same place. Warning: Attempt to present <UIImagePickerController: 0x7c0ae400> on <CAGUCreateContactViewController: 0x7bf61a00> which is already presenting (null) Method to open imagePicker. - (void)openPhotoPicker:(UIImagePickerControllerSourceType

How to allow user to pick the image with Swift?

让人想犯罪 __ 提交于 2019-11-28 15:46:39
I am writing my first iOS application (iPhone only) with Swift. The main application view should allow user to choose the image from the photo gallery. I've found the following sample code of ViewController.swift : class ViewController: UIImagePickerController, UINavigationControllerDelegate, UIImagePickerControllerDelegate { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func tableView

CGAffineTransformInvert: singular matrix in UIImagePickerController with showsCameraControls = NO

[亡魂溺海] 提交于 2019-11-28 12:14:43
I tried this twice with two different apps and I get the same thing. I have a set up a UIImagePIckerController instance as follows: - (IBAction)addImage:(UIBarButtonItem *)sender { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { NSArray *mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera]; if ([mediaTypes containsObject:(NSString *)kUTTypeImage]) { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType =

iOS UIImagePickerController: Any way of getting the date of the chosen Picture?

本小妞迷上赌 提交于 2019-11-28 11:43:07
Within my application I am using an UIImagePickerController which calls - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info on success. The thing is, i need the date at which the image was taken. If the user shot a new picture i can take the current date of course, but what can I do in case the user chose a picture from his camera roll or another saved picture? You can use this code for photos and videos fetched from albums. info is second parameter in the mentioned delegate method. NSURL *mediaUrl = info