uiimagepickercontroller

UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

房东的猫 提交于 2019-11-27 19:14:55
问题 I have a very simple application: - All orientations are permitted with only a button on a screen - The button show a UIImagePickerController (to take a photo) - Build with Xcode 5 and SDK 7 On iOS 8 , the camera of the UIImagePickerController is appearing correctly whether I am in landscape or in portrait, but when I rotate the device, I got the camera view rotated by 90 degrees, here's a an example: I have my app in portrait I push the button that shows me the UIImagePickerController I am

Swift - UIImagePickerController - how to use it?

谁说我不能喝 提交于 2019-11-27 18:58:22
I am trying hard to understand how this works, but it's pretty hard for me. =) I have 1 view, there is one button and one small ImageView area for preview. The button triggers imagepickercontroller, and the UIView will display picked image. There is no error but the image doesn't show in the UIImageView area. var imagePicker = UIImagePickerController() @IBOutlet var imagePreview : UIImageView @IBAction func AddImageButton(sender : AnyObject) { imagePicker.modalPresentationStyle = UIModalPresentationStyle.CurrentContext imagePicker.delegate = self self.presentModalViewController(imagePicker,

iOS Custom UIImagePickerController Camera Crop to Square

给你一囗甜甜゛ 提交于 2019-11-27 17:08:31
I'm trying to create a camera like Instagram where the user can see a box and the image would crop to that box. For Some reason the camera doesn't go all the way to the bottom of the screen and cuts off near the end. I'm also wondering how would I go about cropping the image to be 320x320 exactly inside that square? Here's the easiest way to do it (without reimplementing UIImagePickerController ). First, use an overlay to make the camera field look square. Here's an example for 3.5" screens (you'd need to update it to work for iPhone 5): UIImagePickerController *imagePickerController = [

How to select image from photo library and show the system camera interface within the app?

纵饮孤独 提交于 2019-11-27 16:50:13
问题 How can I let a user select a photo from the Apple Photos library? How do we show the system camera UI to allow the user to take a picture? 回答1: EDIT: March 15, 2016 - Here is a swift version of my prior answer, if you're looking for the objective-c version you'll find it below. -- SWIFT -- First conform to the UIImagePickerControllerDelegate protocol and the UINavigationControllerDelegate protocol class ViewController: UIViewController, UIImagePickerControllerDelegate,

UIImagePickerController working without NS Photo Library and Camera descriptions

假装没事ソ 提交于 2019-11-27 16:28:20
I am working with UIImagePickerController because I am creating an application that allows for the posting of images through both the photo library and camera. I created a basic demo that consists of a UIImageView, UIButton with some code to set up the UIImagePickerController. In addition, I have also set up (NSPhotoLibraryUsageDescription and NSCameraUsageDescription) in the plist section of Xcode. The image picking function works beautifully yet when I run the simulator I am not being queried on whether or not I should let the app allow access to either my camera or photo library. I then

UIImageWriteToSavedPhotosAlbum working… sometimes

蓝咒 提交于 2019-11-27 15:26:22
问题 UIImageWriteToSavedPhotosAlbum is only working sometimes. Sometimes it works, sometimes it doesn't, exact same function. - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { NSLog(@"Saving image to camera roll..."); UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil); NSLog(@"Done!"); } I am using a UIImagePicker controller to get the image that then calls that function. Sometimes it saves it to the

How to load animated GIF from photo library

余生长醉 提交于 2019-11-27 14:13:02
问题 In iOS Swift I'm having difficulty loading an animated GIF from the device photo library to a UIImageView or creating a .gif file from it. I have no problem displaying the animated GIF if it's a file on a server or if it's right in the app. However, when I load it from the photo library, I lose the animation. I found some Objective-C solutions and tried to convert them over to Swift, but haven't had any luck. Here is what I have so far: @IBAction func buttonTapped(sender: UIButton) {

Force UIImagePickerController to take photo in portrait orientation/dimensions iOS

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 14:09:27
The only allowed orientation in my app is landscape. I force this in the project properties under target > summery and only allow portrait in shouldAutorotateToInterfaceOrientation The problem is when I take a picture while holding the phone horizontally (landscape), the photo will be taken in landscape orientation, while the UI remains in portrait mode. This means in landscape mode I get a wide image of 3264 x 2448 instead of the tall image (2448 x 3264) I get in portrait mode. Next the user can crop the image, but if the image is taken in landscape mode I get very ugly stretched images.

UIImagePicker cameraOverlayView appears on Retake screen

青春壹個敷衍的年華 提交于 2019-11-27 14:02:04
I am struggling with a problem. I am capturing a video, and i had put an UIImageView with an UIImage in it as the UIImagePicker CameraOverLay. So when the user starts the camera in order to capture a video, he can see an overlay on the camera. When the user stops capturing, and is being moved to the "cancel or Retake" screen of the UIImagePicker, the cameraOverlayView is still visible. any ideas on how to not display the overlay in the "retake or cancel" screen? Solved by signing up to NSNotificationCenter, and listening to @"_UIImagePickerControllerUserDidCaptureItem" and @"

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

两盒软妹~` 提交于 2019-11-27 13:44:58
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 preview view or just avoid the preview view . Below my code CamViewScreen.h #import <UIKit/UIKit.h>