uiimagepickercontroller

Image not returned by didFinishPickingMediaWithInfo:

左心房为你撑大大i 提交于 2019-12-09 22:11:19
问题 I'm basically trying to 'get' an image from the users photo library (or camera). The problem is, no image is returned when on iPad (Compatibility mode). Here is the code: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSLog(@"info: %@", info); } iPhone and iPhone simulator log (Original image exists): info: { UIImagePickerControllerMediaType = "public.image"; UIImagePickerControllerOriginalImage = "<UIImage: 0x6b6b4e0>";

How to crop image after taken from UIImagePicker Camera?

荒凉一梦 提交于 2019-12-09 17:41:03
问题 I'm trying to allow the user to take 16x9 aspect ratio images to look like they are nice HD photos. I'm using the cameraViewOverlay to overlay black bars on both ends, but when the image is taken, how do I crop the top and bottom without resizing or changing the scale of the image? Thanks. 回答1: There are various posts around on how to scale/crop a UIImage you get back from the camera, like this one. It's a little trickier than you'd expect, because camera images are rotated, so you have to

Force UIImagePickerController to Crop a Square Image

馋奶兔 提交于 2019-12-09 14:40:33
问题 How do we force UIIImagePickerController to crop a square image? I have searched all over and I haven't found a solid solution. Thankyo var imagePickerController: UIImagePickerController = UIImagePickerController(); imagePickerController.allowsEditing = true; imagePickerController.delegate = self; imagePickerController.sourceType = sourceType; func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {

Swift get NSData of a video from photos library

拜拜、爱过 提交于 2019-12-09 13:40:03
问题 Im using UIImagePickerController to select a video from my library. I need to extract the NSData of my video file. Im using the following operation to select a video from my library but my data appears to be nil however my AVPlayer plays the video from the resulting NSURL so I know problem is not with the NSURL. How can I extract the NSData of my selected video file? func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) { let

Customized photo picker view [closed]

妖精的绣舞 提交于 2019-12-09 11:13:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I want to use photo picker view in customized form, such as showing a rectangle in screen to focus on specified area of the picture. However, UIImagePickerController can only offer a normal photo picker view. Is there any other class I can use to replace UIImagePickerController, or should I create a sub class of

how to get the path of the image which is in iphone gallery

北战南征 提交于 2019-12-09 06:49:50
问题 i need to upload a image from iphone gallery ,but i am not getting the path of the picked image (using image picker ) in the image picker delegate method i am doing the following - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; NSString *strImagePath = [info valueForKey

How to prevent a modal UIImagePickerController from rotating?

删除回忆录丶 提交于 2019-12-09 05:30:38
问题 I have an app that fully support rotation. I am modally adding a UIImagePickerController for which there is no support for UIInterfaceOrientationLandscape and I cannot get the controller to stay in portrait. In other words, I need to disable rotation for the UIImagePickerController so it stays in portrait, without removing rotation for the rest of my app. this seems basic, but I can't seem to locate it. How can I prevent this rotation? UPDATE As suggested, I tried subclassing with the

Change title of bar button in UIImagePickerController's navigation bar

烂漫一生 提交于 2019-12-09 05:00:33
my question is simple: how can i change change title of bar button in UIImagePickerController's navigation bar? I created the controller for UIImagePickerController (triggered by the pressure onto a button) and then tried to modify its properties: - (IBAction)chooseFromRoll:(id)sender { if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeSavedPhotosAlbum]){ UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.navigationBar.tintColor = [UIColor colorWithRed:0.42 green:0.18 blue:0.66 alpha:1.0]; //imagePicker.navigationItem

Memory Troubles with UIImagePicker

给你一囗甜甜゛ 提交于 2019-12-09 00:18:08
问题 I'm building an app that has several different sections to it, all of which are pretty image-heavy. It ties in with my client's website and they're a "high-design" type outfit. One piece of the app is images uploaded from the camera or the library, and a tableview that shows a grid of thumbnails. Pretty reliably, when I'm dealing with the camera version of UIImagePickerControl, I get hit for low memory. If I bounce around that part of the app for a while, I occasionally and non-repeatably

UIImagePickerController AVAudioPlayer

末鹿安然 提交于 2019-12-08 20:33:28
问题 When I open a UIImagePickerController , I can display the device's camera input stream. But when I play an AVAudioPlayer with [player play] then the camera stops working. How can I deal with that? 回答1: you can't because UIIMagePickerController is controlling the audio, you will need to use low level AVFoundation in order to do that. checkout AVCam sample code how to record a movie and add the view as subview , that way you will stay in control of the audio and will be able to play audio. 来源: