uiimagepickercontroller

iPhone: Get camera preview

不羁的心 提交于 2019-12-17 17:59:46
问题 I'd like to get the image that is being displayed on the UIImagePickerController when user uses the camera. And when I get I want to process the image and display instead of regular camera view. But the problem is when I want to get the camera view, the image is just a black rectangle. Here's my code: UIView *cameraView = [[[[[[imagePicker.view subviews] objectAtIndex:0] subviews] objectAtIndex: 0] subviews] objectAtIndex: 0]; UIGraphicsBeginImageContext( CGSizeMake(320, 427) ); [cameraView

Front facing camera in UIImagePickerController

微笑、不失礼 提交于 2019-12-17 17:28:35
问题 I am developing the front facing camera app in iPad2 by using the UIImagePickerController . When I capture the image it's shows as flipped from left to right. How do I correct this? if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *imgPkr = [[UIImagePickerController alloc] init]; imgPkr.delegate = self; imgPkr.sourceType = UIImagePickerControllerSourceTypeCamera; imgPkr.cameraDevice=UIImagePickerControllerCameraDeviceFront;

Access metadata (exif tags) of image taken by UIImagePickerController - iOS/iPhone

删除回忆录丶 提交于 2019-12-17 16:37:39
问题 Is it possible to access the metadata of an image captured by UIImagePickerController in iOS? I understand this can be done with AssetLibrary framework for images captured by the camera application (or otherwise present in the iPhone photo library), but can a developer access any of the metadata/exif info from within an application right after a user has taken a picture? I'm looking for any type of camera exposure-level info from an image after it has been taken. Thanks! 回答1: Apparently, you

How to get file name in UIImagePickerController with Asset library?

北战南征 提交于 2019-12-17 16:35:38
问题 I want to get the file name from UIImagePickerController . I do not want to use ALAssetLibrary because it is deprecated in iOS 9. I have used the following code but it always returns the image name as "Asset.jpg" for each file. func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { let originalImage = (info[UIImagePickerControllerOriginalImage] as? UIImage)! let url = info[UIImagePickerControllerReferenceURL] as! NSURL imageData =

Swift ImagePickerController didFinishPickingMediaWithInfo not fired

爱⌒轻易说出口 提交于 2019-12-17 16:32:00
问题 I use the ImagePickerController , to grab a profile image. The user has a button. The button triggers the CamRoll function. When the button is clicked, the normal ImagePickerViewController appears, but the didFinishPickingMediaWithInfo isn't called. In an earlier version of Swift/Xcode, the same code was called. This is my code. import UIKit class AnnonseViewController: UIViewController, UIImagePickerControllerDelegate { @IBOutlet var Image: UIImageView! override func viewDidLoad() { super

iPhone camera, how to avoid cameraOverlay on preivew view; How to know when entering preview view?

那年仲夏 提交于 2019-12-17 10:54:33
问题 On the camera workflow, the photo is captured and on the next screen, let's call it choose-screen , you can choose if you want to use this photo or retake it. How do I know, when the camera enteres the preview view ? My issue is that I have added a button to access the camera roll, which works fine. The obstacle is, when taking a photo and entering the preview view (2. Camera View), the button hides the "use photo" option. So I cannot select it. I want to hide the button when entering the

iOS 7 UIImagePickerController has black preview

梦想的初衷 提交于 2019-12-17 06:38:23
问题 I have a UIImagePickerController being called with sourceType camera and 80% of the time I get a black preview. If I wait, let's say around 30 seconds, I get a good preview and it will be good for around 50% of the time, then it can break again. The image in question is very similar to this. iDevice camera shows black instead of preview Other people imply that GCD might be causing some issues with the camera, and that updates to the UI while the image picker is being loaded break it. I put a

Using UIImagePickerController in landscape orientation

五迷三道 提交于 2019-12-17 06:09:04
问题 I am creating an app which is in landscape mode and I am using UIImagePickerController to take photos using iPhone camera in it and I want to create it in landscape mode too. But as the Apple documention suggests UIImagePickerController does not support landscape orientation, so what should I do to get desired functionality? 回答1: If you'd like to use UIImagePickerController in landscape mode, use user1673099's answer, but instead of: - (BOOL)shouldAutorotate { return NO; } use: -

Set dimensions for UIImagePickerController “move and scale” cropbox

风格不统一 提交于 2019-12-17 05:42:07
问题 How does the "move and scale screen" determine dimensions for its cropbox? Basically I would like to set a fixed width and height for the "CropRect" and let the user move and scale his image to fit in to that box as desired. Does anyone know how to do this? (Or if it is even possible with the UIImagePickerController) Thanks! 回答1: Not possible with UIImagePickerController unfortunately. The solution I recommend is to disable editing for the image picker and handle it yourself. For instance, I

Picking two different images in the same view controller using imagePickerController in Swift

落爺英雄遲暮 提交于 2019-12-17 05:08:11
问题 I am making an app in which there are two UIImageViews. In each image view the user needs to be able to input a different image. Here is the code I have so far. var imagePicker = UIImagePickerController() @IBAction func chooseImage1(sender: AnyObject) { if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.SavedPhotosAlbum){ println("Button capture") imagePicker.delegate = self imagePicker.sourceType = .SavedPhotosAlbum imagePicker.allowsEditing = false self