uiimagepickercontroller

Set minimum zoom level for UIImagePickerController cropping

有些话、适合烂在心里 提交于 2019-11-30 21:28:58
I am using a UIImagePickerController to allow the user to upload a photo for use in my application. After selecting a photo to upload, the user is then prompted to crop his/her photo (since I have set imagePickerController.allowsEditing = YES ). However, if the photo is landscape (i.e., wider than it is taller), it is currently possible for the user to crop the photo in a way that does not output a square image. This is because the default zoom level when cropping landscape photos is aspectFit rather than aspectFill (as it is for portrait photos). Is it possible to set the minimum zoom level

How can I set the UIImagePickerController orientation for video?

做~自己de王妃 提交于 2019-11-30 20:58:50
问题 My app uses the UIImagePickerController to record a video, and I'm then uploading it to our Amazon server using ASIS3Request. Whilst the video always plays in the correct orientation on the device, the orientation is wrong when viewed in some browsers. Is there a way for me to manually set the orientation of the phone onto the image file when it's being taken? Or is the problem exclusively with the browsers (and if so, how can I fix that)? Thank you. S.O. for president! Duncan 回答1: the iPhone

uiimagepickerview controller creating memory leaks in iphone - why?

青春壹個敷衍的年華 提交于 2019-11-30 20:42:57
问题 uiimagepickerview controller creating memory leaks in iphone - why? Try to implement ui image picker view controller in your application & debug it. You will find memory leaks in your application. Why ui image picker view controller creates memory leaks. -(void)addPhotos:(id)sender { if(imagePickerController==nil){ imagePickerController=[[UIImagePickerController alloc]init]; imagePickerController.delegate=self; imagePickerController.sourceType=UIImagePickerControllerSourceTypeSavedPhotosAlbum

UIImagePickerControllerReferenceURL always returns nill

邮差的信 提交于 2019-11-30 20:26:29
I am trying to get the name of the image which I have just captured from camera with following code. But [info objectForKey:@"UIImagePickerControllerReferenceURL"] always returning nil. How can I get the URL? - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { self.myinfo = info; NSLog(@"Dismissing camera ui..."); [self.cameraUI dismissViewControllerAnimated:YES completion:nil]; NSLog(@"Getting media url..."); NSString *mediaURL = [info objectForKey:UIImagePickerControllerMediaURL]; NSLog(@"Media url = %@", mediaURL); NSLog(@

Take Photos Automatically - iPhone

天大地大妈咪最大 提交于 2019-11-30 20:24:06
问题 I'm trying to perform the task of taking a picture, but triggered by code instead of relying on the touching of the camera button in UIImagePickerController. Can this be done? I want to take a 10 pictures, 1 per second. 回答1: You should look into the AVFoundation framework -- that makes it pretty easy to do. 回答2: As answered here, check out Apple's AVCam sample. It shows how to get both still images and video from the camera. 来源: https://stackoverflow.com/questions/4966134/take-photos

UIImagePickerController's cameraViewTransform is ignoring 'scaling' and 'translation' on iOS 10 beta

两盒软妹~` 提交于 2019-11-30 18:43:29
I have been using below code to scale my UIImagePickerController's live preview to fill the entire screen. This worked perfectly till now. Before few days, I installed iOS 10 beta 7 on an iPhone 5 and it doesn't scale anymore. I can see black patch at the bottom of UIImagePickerController's view. Seems like cameraViewTransform is ignoring the CGAffineTransformMakeScale and CGAffineTransformMakeTranslation calls. This is how I initiate my camera controller. I have set both "allowsEditing" and "showsCameraControls" to 'NO' in order to provide my own custom overlay view. objImagePickerController

UIImagePickerController delegate warning

南楼画角 提交于 2019-11-30 18:08:57
I've just put a photo picker into my project, and everything works fine. The only thing is it insists on giving me the following warning where I set the delegate - Assigning to 'id<UINavigationControllerDelegate,UIImagePickerDelegate>' from incompatible type 'AddTargetViewController *' I have set up the delegate in the AddTargetViewController.h in the normal way - @interface AddTargetViewController : UIViewController <UIImagePickerControllerDelegate> and I can't see anything wrong. As I say, it works fine, and all the delegate methods fire off as they should. -(void)takePhoto {

UIImagePickerController how to hide the flip camera button?

三世轮回 提交于 2019-11-30 17:51:18
问题 is there a way to hide the flip camera button inside the UIImagePickerController? thanks for reading !^_^! 回答1: I ended up using a custom subclass of UIImagePickerController to fix this (and other) issues: #import "SMImagePickerController.h" @implementation SMImagePickerController void hideFlipButtonInSubviews(UIView *view) { if ([[[view class] description] isEqualToString:@"CAMFlipButton"]) { [view setHidden:YES]; } else { for (UIView *subview in [view subviews]) { hideFlipButtonInSubviews

how to know is it iphone or ipad?

假如想象 提交于 2019-11-30 17:41:48
问题 i want to know the user uses the iphone or ipad,if the user uses the iphone i want to open the camera,if he uses the ipad or runs in simulator i want to open the library. how it is possible? how to find the details of devices? how to know current using device by user through xcode? 回答1: You should not determine whether there is a camera by looking at the model. This is not future proof - for instance, you would not be supporting the iPad 2's camera. UIImagePickerController has a special

Why can’t UIImagePickerController be pushed into navigation stack?

别等时光非礼了梦想. 提交于 2019-11-30 17:16:36
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! Apple does not allow stacking of navigation bars. Since the image picker has its own navigation bar, it cannot be placed in a navigation stack. The result would cause user confusion since there