uiimagepickercontroller

Upload picture selected using UIImagePickerController

主宰稳场 提交于 2019-11-29 16:56:13
I'm trying to upload the picture selected using UIImagePickerController. The UIImagePickerController gives UIImage object that I can display in a view, but it doesn't give a path (may be it does and I'm looking at wrong place). I'm using ASIFormDataRequest to upload content, but this would need path to the picture to upload it. Any suggestion ? Thank you If you have UIImage with you than you don't need local path for image to upload, you can upload it using following code. NSData *imgData = UIImagePNGRepresentation(YourUIImageObject); NSURL *url = @"yourURL"; ASIFormDataRequest *currentRequest

UIImagePickerController Overlay Buttons Not Firing

丶灬走出姿态 提交于 2019-11-29 15:42:02
I have a UIImagePickerController of type camera when the user lands on a page. I have put a custom camera overlay on top of the UIImagePickerController, but none of the button events are firing. I know most of this code is from a base Apple code, so I am perplexed as to what is happening. @interface TakePhotoViewController : UIImagePickerController <UIImagePickerControllerDelegate, UINavigationControllerDelegate> ... - (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType { if (self.capturedImages.count > 0) { [self.capturedImages removeAllObjects]; } self.sourceType

UIImagePickerController disable iPhone 4S face detection (iOS 5.1)

心已入冬 提交于 2019-11-29 15:31:39
I am currently developing an iPhone app that makes use of a UIImagePickerController with a custom overlay to take photos. Unfortunately I do not have direct access to an iPhone 4S but several testers have reported that the camera picker is drawing a green border around faces exactly like this: http://cdn.iphonehacks.com/wp-content/uploads/2012/03/camera_faces.jpg Due to the nature of this app this is not desirable. A thorough search of the UIImagePickerController docs didn't turn up anything and similarly everything I could find on here relating to face detection was providing instructions in

Displaying UIImagePickerController within another UIView

↘锁芯ラ 提交于 2019-11-29 15:27:24
I've been working pretty extensively the last couple months with UIImagePickerController, particularly with the new capabilities in OS3.1 and newer to overlay views on-top of the camera view. This has worked just fine. However, I am currently working on a project where I'd like to be able to display the camera view of the UIImagePickerController within an existing view. Essentially, the exact opposite of what I've currently been doing. An example would be a View Controller with navigation components (Think top and bottom horizontal bars with gradients), and upon tapping a button on one of

Swift 3.0 - how to hide status bar after calling UIImagePickerController?

為{幸葍}努か 提交于 2019-11-29 14:51:41
Happy New Year! I want to hide status bar after calling UIImagePickerController on iOS 10.2. You know there are already several questions about it with some answers, but I'm afraid the answers don't work for Swift 3.0. The suggested answers are: extend UINavigationController to override preferStatusBarHidden, because UIImagePickerController is a subclass of UINavigationController. So I tried: extension UINavigationController{ open override var prefersStatusBarHidden: Bool{ return true } } extend UIImagePickerController to override prefersStatusBarHidden. So I tried: extension

how to get path of picture taken by camera ios swift

僤鯓⒐⒋嵵緔 提交于 2019-11-29 14:22:18
I was using the imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo delegate method for getting the url of the image which user chose on photo gallery. But when I try to get URL for image taken by camera its return nill. Here is my code. func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { if (imagePicker.sourceType == UIImagePickerControllerSourceType.camera) { let data = UIImagePNGRepresentation(pickedImage) UIImageWriteToSavedPhotosAlbum(pickedImage, nil, nil, nil) if let image = info

App Terminated due to Memory Pressure when using camera in iOS 7

时光怂恿深爱的人放手 提交于 2019-11-29 14:18:27
问题 I am facing error App Terminated due to Memory Pressure when I capture some images using UIImagePickerController Camera. I receive memory warnings first and then suddenly app crashes. This issue is in iOS 7 specifically as in iOS 6 it is working fine. Does someone know why is this memory issue occuring in iOS 7 on using camera. Note: I tried to minimize RAM usage because it may also be the reason for this memory pressure. But still getting warning. 回答1: I just posted this answer on a similar

Changing NavigationBar Title of UIImagePickerController

江枫思渺然 提交于 2019-11-29 14:15:00
I want to know how we can change the navigation bar title of UIImagePickerController. I tried several ways but couldn't do it. tried the follwing ways, imgPicker.title = [NSString stringWithString:@"My Name"]; imgPicker.navigationItem.title = [NSString stringWithString:@"My Name"]; But it still gives me the default title called "Photo Albums".Can anyone please tell me how to do it?.... Thanks.... I found the way to do it. When you set your UIImagePickerController delegate to self and implement the following method it worked. - (void)navigationController:(UINavigationController *

UIImagePickerController: Detecting Camera button (shutter) pressed

情到浓时终转凉″ 提交于 2019-11-29 12:37:27
I would like to call a method that takes an NSNotification immediately after the user presses the camera shutter (i.e when the "Preview" tab bar has the buttons "Retake" and "Use"). I can't use the didFinishPickingImage method because at this time the user has already pressed the "Use" button. I have already implemented this by cameraOverlayView property of UIImagePickerController(see comments), but I wonder whether there are quicker ways of 'observing' this action. Any ideas? Axel To learn about camera button press event, you can fire a NSNotification for it. // Add observer for when camera

iOS 4.3 changed transformation on UIImagePickerController's camera overlay view

陌路散爱 提交于 2019-11-29 12:14:43
After testing my App on iOS 4.3 I noticed that the camera overlay of my UIImagePickerController has an added transformation that stretched the content extremely. Pre iOS 4.3 everything shows up correctly. Here is what I do imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; cameraOverlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; cameraOverlay.backgroundColor = [UIColor clearColor]; cameraOverlay.userInteractionEnabled = NO; //add subviews to camera Overlay imagePicker