uiimagepickercontroller

let user crop image in iOS

隐身守侯 提交于 2019-12-08 07:31:18
问题 Is there a built in function in objective-c to do image cropping like the one in iOS photo gallery? I have tried enabling editing in UIImagePickerController, but it doesn't do the same. Thanks! 回答1: there are quite a few ways to crop images using the Core Graphics functions, the most basic one would be: CGRect cropRect = CGRectMake(0, 0, 100, 100); CGImageRef cropped_img = CGImageCreateWithImageInRect(yourUIImage.CGImage, cropRect) 回答2: This is no built in function. The way to do it would be

Camera Flash Turn Auto/On/Off with UIImagePickerController in IOS - Swift

青春壹個敷衍的年華 提交于 2019-12-08 07:26:04
问题 I am very new to IOS Swift. But I am building a sample camera app that takes picture and video and then saved to photo gallery. But I want user to choose Auto/On/Off Flash option on the Camera View and when the user takes the picture then flash turns on or turns off depending on option what he/she chooses. I am using UIImagePickerController to customize camera features. I couldn't get much suggestions so far on how can I able to On/Off feature on the camera view and the camera flash works

UIImagePickerControllerCameraDeviceFront works every other time

对着背影说爱祢 提交于 2019-12-08 06:46:06
问题 This question is very similar to an existing question asked here UIImagePickerControllerCameraDeviceFront only works every other time I tried the solution presented but it didn't work for me I have a simplest of a project with two view controllers. In the blue one I am displaying a small UIView with a UIImagePickerController in it. NOTE: I am displaying front facing camera when app is launched. I hit the next button and go to orange view controller and when I hit the back button and come back

Change title of bar button in UIImagePickerController's navigation bar

非 Y 不嫁゛ 提交于 2019-12-08 06:40:24
问题 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

Open UIImagePickerController when view loads

人盡茶涼 提交于 2019-12-08 06:09:35
问题 I have a UIViewController, that I would like upon loading the view - to open a UIImagePickerController for the camera. A. I wrote the following: EDITED - I am using now viewDidAppear - (void)viewDidAppear:(BOOL)animated{ imagePicker = [[UIImagePickerController alloc] init]; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){ [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; } else{ [imagePicker setSourceType

UIImagePickerController Camera Source Problem

混江龙づ霸主 提交于 2019-12-08 05:34:33
问题 Ok here is the code that I wrote to display the UIImagePickerController in the camera source. I just declared the myPhotopicker in the header for the property and retain it. Synthesized it in the main code file. Then calling the picker I wrote the code below: if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { if (myPhotopicker==nil) { myPhotopicker = [[UIImagePickerController alloc] init]; myPhotopicker.delegate = self; }// create once!

open camera from UITableViewCell iOS

孤街醉人 提交于 2019-12-08 05:15:34
问题 I have a UITableView and a UITableViewCell. In every UITableViewCell I want to open gallery or click an image. I normally present UIImageviewController like - (IBAction)takePhoto:(UIButton *)sender { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = YES; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentViewController:picker animated:YES completion:NULL]; } How can I present from cell ? Misha :) 回答1

UIImagePickerController messing tabbar frame when dismissing

好久不见. 提交于 2019-12-08 04:54:48
问题 I am trying to show a UIImagePickerController in a UIViewController inside a UITabBarController SourceType Camera MediaType kUTTypeMovie There's no issue presenting the UIImagePickerController, but when dismissed the TabBar moves down half the height, it only happens sometimes... other it dismisses perfectly. override func viewDidLoad() { var test: UIButton = UIButton(frame:CGRectMake(140, 200, 100, 100)) test.backgroundColor = UIColor.redColor() test.addTarget(self, action:"presentCamera",

How to do properly cropping of UIImage taken with UIImagePickerController?

空扰寡人 提交于 2019-12-08 04:07:08
问题 This is camera overlay for my app, The yellow square is to indicate user that only photo inside this part (in camera) will be saved. It's like crop. When I saved that capture image, it'll save zoomed photo [a big zoomed on photo], What I found is, when I took a photo, it'll be of size of {2448, 3264} I'm cropping the image like this, - (UIImage *)imageByCroppingImage:(UIImage *)image toSize:(CGSize)size { double x = (image.size.width - size.width) / 2.0; double y = (image.size.height - size

One UIImagePickerController for multiple ImageVIews

老子叫甜甜 提交于 2019-12-08 03:43:39
问题 could you please help me with UIImagePickerController I have 12 ImageViews in 1 ViewController. I need help so that each ImageView could pick different photos from Library. Someone told me to use Tags for them but I can't make it work cause i'm new in Swift. 回答1: Enable User Interaction Enabled for each UIImageView on a Storyboard. Add TapGestureRecogniser to each UIImageView . Connect each TapGestureRecogniser with IBAction . @IBAction func tap(_ sender: UITapGestureRecognizer) {