uiimagepickercontroller

Programmatically Take Picture Without User Interaction

烂漫一生 提交于 2019-12-05 16:54:56
How do I take Picture without User Interaction or without presenting ImagePickerController UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { [imagePickerController setSourceType:UIImagePickerControllerSourceTypeCamera]; } // image picker needs a delegate, [imagePickerController setDelegate:self]; // Place image picker on the screen [self presentModalViewController:imagePickerController animated:YES]; - (void)imagePickerController:(UIImagePickerController *

How to speed up saving a UIImagePickerController image from the camera to the filesystem via UIImagePNGRepresentation()?

痴心易碎 提交于 2019-12-05 16:05:54
I'm making an applications that let users take a photo and show them both in thumbnail and photo viewer. I have NSManagedObject class called photo and photo has a method that takes UIImage and converts it to PNG using UIImagePNGRepresentation() and saves it to filesystem. After this operation, resize the image to thumbnail size and save it. The problem here is UIImagePNGRepresentation() and conversion of image size seems to be really slow and I don't know if this is a right way to do it. Tell me if anyone know the best way to accomplish what I want to do. Thank you in advance. Depending on the

cameraOverlayView above Shutter animation

≡放荡痞女 提交于 2019-12-05 14:41:33
I have a transparent view with a rectangle drawn onto it using CoreGraphics. When the camera launches the custom overlay view is above the shutter animation. What you see is the standard camera shutter with the custom rectangle above it. How do I get it to go in the right place, underneath the shutter animation? I've looked at other sample code but it's for OS 3.1 and doesn't seem to do anything differently. Here's my code: -(IBAction)cameraButton{ if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerCameraDeviceRear]){ UIImagePickerController *picker = [

Capture camera view and onverlay in an image

☆樱花仙子☆ 提交于 2019-12-05 14:41:30
I open the camera view and place an image as an overlay. I then want to save both the overlay and the camera view's image as one image. Previously I achieved this using UIGetScreenImage(). Now that Apple forbid this what are my options ? takePicture will only capture the camera data but the the overlay. Merging the overlay with the image from takePicture is a bit slow. You really will have to merge them, and it shouldn't take more than a second or two. Something like(untested, but should give an idea): UIGraphicsBeginImageContext(myCapturedImage.size); [myCapturedImage drawAtPoint:CGPointZero]

Swift 3 select multiple photos using UIImagePickerController

旧街凉风 提交于 2019-12-05 14:38:06
I have a UIImagePickerController which with it I select a photo from Library, or take a photo with Camera and then show the selected photo in a UIImageView . I want to upload this photo later to an API (which still don't know how to upload photos, have never done it). So what I want is a feature like WhatsApp selecting photos feature which you can select let's say 20 photos and then you can see them. (I mean for my case I only have one UIImageView and can only show one photo. What is the solution? please keep in mind that I want to upload this photos later. Thanks in advance Abed Naseri As

Photo Library view stays on screen after choosing an image with UIImagePickerController

本秂侑毒 提交于 2019-12-05 12:13:51
After I choose a picture through the UIImagePickerController interface from the Photo Library, the Photo Library view stays displayed, even though I've called dismissModelViewControllerAnimated in imagePickerController:didFinishPickingImage:editingInfo . Has anyone seen this? These are the three relevant methods I'm using: - (IBAction)choosePictureFromLibrary:(id)sender { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { UIImagePickerController* picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsImageEditing

UIImagePickerController crashes on rapid scrolling, slower than photos app

百般思念 提交于 2019-12-05 12:06:21
Most of the time, my image picker works perfectly (iOS 4.2.1). However, if I scroll very rapidly up and down about 4-6 times through my camera roll of about 300 photos, I get a crash. This never happens with the "photos" app on the same iPhone 3Gs. Also, I'm noticing that the stock "photos" app scrolls much more smoothly than my image picker. Has anyone else noticed this behavior? I'd be interested if others could attempt this in their own apps and see if they crash. I don't think it's related to other objects hogging memory on my iPhone because it's a simple app, and this happens right after

How to set the resolution of a saved image from the UIImagePickerController

佐手、 提交于 2019-12-05 10:53:11
问题 I'm using an UIImagePickerController to set a picture from my cameraroll to a UIImageView. However the image is getting scaled automaticly inside this UIImageView because I mentioned 'scale to fit' inside the IB. I'd like to save my chosen image with a resolution of 80x80 pixels so that I won't have to scale. (My App is getting realy slow because of this scaling issue.) Here's a snippit from my code: -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage :

How to present a ViewController with a UIImagePickerController

狂风中的少年 提交于 2019-12-05 10:37:30
I'm attempting to present an ImagePicker , and there after the user has selected an image, present an image editing ViewController where the user can manipulate the image and then send the edited image back to the original ViewController . Question: Is there a standard or best practice approach starting with an initial ViewControlle, then present an ImagePicker there after another ViewController to do the imaging editing, and then display it all back in the initial ViewController, all while making the transitions look seamless? Is the suggestion in Try 3 below a good practice method or is

Custom “Use”, “Cancel”,“Retake” and “Reverse Camera” button event using UIImagePickerController

不想你离开。 提交于 2019-12-05 09:06:56
问题 I am making a custom photo picker. so i have used imagePickerController.showsCameraControls = NO; And i have created one camera overlay view and use imagePickerController.cameraOverlayView = overlayView; So, I need to implement custom button option, Can anyone please tell me how can i give customize button event using UIImagePickerController? Thanks in advance. 回答1: You can build a UIViewController, take it's view as the image picker's overlayView. All your custom buttons are controlled by