uiimagepickercontroller

How to select a portion of an image, crop, and save it using Swift?

人走茶凉 提交于 2019-11-30 01:57:42
I am trying to create an iOS app using Swift to capture images and let the user save a selected portion of the image. In many cam based apps, I noticed that a rectangular frame is offered to let the users choose the desired portion. This involves either sliding the edges of the rectangle or moving the corners to fit the required area. Could you please guide me on how to implement that moveable rectangle and how to save only that piece of the image? Using Swift 3 Image cropping can be done using CGImages from CoreGraphics . Get the CGImage version of a UIImage like this: // cgImage is an

UIImagePickerController bug

拜拜、爱过 提交于 2019-11-30 01:37:46
I think I found a bug in latest iOS 7 by running an app with Base SDK set to iOS 6.1 (possibly even lower versions too, haven't tested that out yet) I have this image in my photo library: http://i.imgur.com/7KUIGLt.jpg I present a UIImagePickerController via: UIImagePickerController *vc = [[UIImagePickerController alloc] init]; vc.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; vc.delegate = self; vc.allowsEditing = YES; [self presentViewController:vc animated:YES completion:nil]; I save the chosen image to my desktop (I am running this on simulator, but this works on device too) -

Why can’t UIImagePickerController be pushed into navigation stack?

你说的曾经没有我的故事 提交于 2019-11-30 00:50:32
问题 When using pushViewController to push UIImagePickerController : [self.navigationController pushViewController:pvc animated:YES]; an error will occur such as: Pushing a navigation controller is not supported The right solution is to use presentModalViewController : [self presentModalViewController:pvc animated:YES]; Can someone explain why this is necessary? What‘s hidden in UIViewController ? Thanks! 回答1: Apple does not allow stacking of navigation bars. Since the image picker has its own

UIImagePickerController returning incorrect image orientation

大城市里の小女人 提交于 2019-11-30 00:47:08
I'm using UIImagePickerController to capture an image and then store it. However, when i try to rescale it, the orientation value i get out of this image is incorrect. When i take a snap by holding the phone Up, it gives me orientation of Left. Has anyone experienced this issue? The UIImagePickerController dictionary shows following information: { UIImagePickerControllerMediaMetadata = { DPIHeight = 72; DPIWidth = 72; Orientation = 3; "{Exif}" = { ApertureValue = "2.970853654340484"; ColorSpace = 1; DateTimeDigitized = "2011:02:14 10:26:17"; DateTimeOriginal = "2011:02:14 10:26:17";

Memory Warning UIImagepickerController IOS 7

天涯浪子 提交于 2019-11-30 00:45:52
Could anybody help me with this issue I'm a bit new to objective c and iOS. I've been working on it but I can't figure out how to fix the problem, My app is really simple it only start the camera take pictures and send them through email to our server. This code was working just fine in iOS6. When I take pictures my memory is heap growth with each screen capture and I get "Received Memory Warning" and finally - Terminated due to Memory Pressure. - -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self.popoverController2

UIImagePickerController does not work correct on ios 9.3 iPad 4

感情迁移 提交于 2019-11-29 23:12:20
After update ipad to ios 9.3 images are stop to display. What can be wrong with it? On iOS 9 and iOS 9.2 that was work as well. On other devices iPhone devices all work fine. private func presentPickerForLibrary() { let imagePicker = UIImagePickerController() imagePicker.allowsEditing = false imagePicker.sourceType = .PhotoLibrary imagePicker.delegate = self presentViewController(imagePicker, animated: true, completion: nil) } Seems to be linked to iCloud Photo Library setting. Turning this on in Preferences fixes the issue for me. I'm seeing this as well in an older, non-universal, iPhone app

Redbar Noticed when dismissing UIImagePickerController

风格不统一 提交于 2019-11-29 22:22:26
问题 I am using the UIImagePickerController to record, edit and save Video to file. While dismissing the UIImagePickerController the status bar blinks red and disappears. I want to avoid this. I have been noticing this in decreasing frequency from iOS8.1, iOS8, iOS7.1 ,etc - (void) cameraClicked{ self.recordState=KRERecordStateRecording; UIImagePickerController *pickerController = [[UIImagePickerController alloc] init]; pickerController.delegate = self; pickerController.sourceType =

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

我们两清 提交于 2019-11-29 20:43:40
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 didFinishPickingMediaWithInfo:(NSDictionary *)info { selectedVideoUrl = [info objectForKey

iOS Swift 3 Image rotated 90 degrees Left

℡╲_俬逩灬. 提交于 2019-11-29 19:55:10
问题 In my app I have a feature to take a picture from camera and upload it to server. My problem is that when I'm getting response back from server that image is rotating to 90 degree left side. Here is my tried code: func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { self.PickerFrom = self.PickerFrom2 if let pickedImage = info[UIImagePickerControllerOriginalImage] as? UIImage { self.AttachmentImageView.image = pickedImage } dismiss

Change text of UIAlertView when recording a video with UIImagePickerController and reaching the videoMaximumDuration

落花浮王杯 提交于 2019-11-29 18:42:30
I'd want to know how to change to text of the UIAlertView appearing when I record a video with a UIImagePickerController and I reach the videoMaximumDuration. If it is not possible to change the text of that UIAlertView , is it at least possible to display it in another language ? Edit : the default text is "The maximum length for this video has been reached" with title "Video Recording Stopped". Thank you, aimak The text of the alert is localized to the current locale settings of the device, and unless you want to walk the view hierarchy looking for the UIAlertView and set its message